public class MemoryTracker extends Object
| Constructor and Description |
|---|
MemoryTracker() |
| Modifier and Type | Method and Description |
|---|---|
void |
decrementAllocatedAmount(int deviceId,
long memorySubtracted)
This method decrements amount of regular allocated memory
|
void |
decrementAllocatedHostAmount(long numBytes) |
void |
decrementCachedAmount(int deviceId,
long memorySubtracted)
This method decrements amount of cached memory
|
void |
decrementCachedHostAmount(long numBytes) |
void |
decrementWorkspaceAmount(int deviceId,
long memorySubtracted)
This method decrements amount of memory allocated within workspaces
|
long |
getActiveHostAmount()
This method returns number of bytes allocated and cached in host ram
|
long |
getActiveMemory(int deviceId)
This method returns total amount of device memory allocated on specified device
Includes: workspace memory, cached memory, regular memory
|
long |
getAllocatedAmount(int deviceId) |
long |
getAllocatedHostAmount()
This method returns number of bytes currently allocated from host memory
|
long |
getApproximateFreeMemory(int deviceId)
This method returns approximate free memory on specified device
|
long |
getCachedAmount(int deviceId) |
long |
getCachedHostAmount()
This method returns number of bytes currently cached from host memory
|
long |
getFreeMemory(int deviceId) |
static MemoryTracker |
getInstance() |
long |
getManagedMemory(int deviceId)
This method returns amount of memory that relies on JVM GC
Includes: cached memory, regular allocated memory
|
long |
getPreciseFreeMemory(int deviceId)
This method returns precise amount of free memory on specified device
|
long |
getTotalMemory(int deviceId) |
long |
getUsableMemory(int deviceId)
This method returns delta between total memory and free memory
|
long |
getWorkspaceAllocatedAmount(int deviceId) |
void |
incrementAllocatedAmount(int deviceId,
long memoryAdded)
This method increments amount of regular allocated memory
|
void |
incrementAllocatedHostAmount(long numBytes) |
void |
incrementCachedAmount(int deviceId,
long memoryAdded)
This method increments amount of cached memory
|
void |
incrementCachedHostAmount(long numBytes) |
void |
incrementWorkspaceAllocatedAmount(int deviceId,
long memoryAdded)
This method increments amount of memory allocated within workspaces
|
public static MemoryTracker getInstance()
public long getAllocatedAmount(int deviceId)
public long getCachedAmount(int deviceId)
public long getCachedHostAmount()
public long getAllocatedHostAmount()
public long getActiveHostAmount()
public void incrementCachedHostAmount(long numBytes)
public void incrementAllocatedHostAmount(long numBytes)
public void decrementCachedHostAmount(long numBytes)
public void decrementAllocatedHostAmount(long numBytes)
public long getWorkspaceAllocatedAmount(int deviceId)
public long getTotalMemory(int deviceId)
public long getFreeMemory(int deviceId)
public long getApproximateFreeMemory(int deviceId)
deviceId - public long getPreciseFreeMemory(int deviceId)
deviceId - public long getUsableMemory(int deviceId)
deviceId - public long getActiveMemory(int deviceId)
deviceId - public long getManagedMemory(int deviceId)
deviceId - public void incrementAllocatedAmount(int deviceId,
long memoryAdded)
deviceId - memoryAdded - public void incrementCachedAmount(int deviceId,
long memoryAdded)
deviceId - memoryAdded - public void decrementAllocatedAmount(int deviceId,
long memorySubtracted)
deviceId - memorySubtracted - public void decrementCachedAmount(int deviceId,
long memorySubtracted)
deviceId - memorySubtracted - public void incrementWorkspaceAllocatedAmount(int deviceId,
long memoryAdded)
deviceId - memoryAdded - public void decrementWorkspaceAmount(int deviceId,
long memorySubtracted)
deviceId - memorySubtracted - Copyright © 2022. All rights reserved.