public interface MemoryManager
Modifier and Type | Method and Description |
---|---|
org.bytedeco.javacpp.Pointer |
allocate(long bytes,
MemoryKind kind,
boolean initialize)
This method returns pointer to allocated memory
PLEASE NOTE: Cache options depend on specific implementations
|
void |
collect(INDArray... arrays)
This method detaches off-heap memory from passed INDArray instances, and optionally stores them in cache for future reuse
PLEASE NOTE: Cache options depend on specific implementations
|
int |
getAutoGcWindow()
This method reutrns
|
int |
getAverageLoopTime()
This method returns average time between invokeGCOccasionally() calls
|
MemoryWorkspace |
getCurrentWorkspace() |
long |
getLastGcTime()
This method returns time (in milliseconds) of the las System.gc() call
|
int |
getOccasionalGcFrequency()
This method returns
|
void |
invokeGc()
This method calls for GC.
|
void |
invokeGcOccasionally()
This method calls for GC, and if frequency is met - System.gc() will be called
|
boolean |
isPeriodicGcActive()
This method returns true, if periodic GC is active.
|
void |
memcpy(DataBuffer dstBuffer,
DataBuffer srcBuffer)
This method does memcpy from source buffer to destination buffer
PLEASE NOTE: This method is NOT safe.
|
void |
memset(INDArray array)
This method fills given INDArray with zeroes.
|
void |
notifyScopeEntered()
PLEASE NOTE: This method is under development yet.
|
void |
notifyScopeLeft()
PLEASE NOTE: This method is under development yet.
|
void |
purgeCaches()
This method purges all cached memory chunks
|
void |
release(org.bytedeco.javacpp.Pointer pointer,
MemoryKind kind)
This method releases previously allocated memory chunk
|
MemoryWorkspace |
scopeOutOfWorkspaces()
This method temporary opens block out of any workspace scope.
|
void |
setAutoGcWindow(int windowMillis)
This method enables/disables periodic System.gc() calls.
|
void |
setCurrentWorkspace(MemoryWorkspace workspace) |
void |
setOccasionalGcFrequency(int frequency)
Sets manual GC invocation frequency.
|
void |
toggleAveraging(boolean enabled)
This method enables/disables calculation of average time spent within loops
Default: false
|
void |
togglePeriodicGc(boolean enabled)
This method enables/disables periodic GC
|
MemoryWorkspace getCurrentWorkspace()
void setCurrentWorkspace(MemoryWorkspace workspace)
void notifyScopeEntered()
void notifyScopeLeft()
void invokeGcOccasionally()
void invokeGc()
void togglePeriodicGc(boolean enabled)
enabled
- void toggleAveraging(boolean enabled)
enabled
- boolean isPeriodicGcActive()
long getLastGcTime()
void setOccasionalGcFrequency(int frequency)
frequency
- int getOccasionalGcFrequency()
int getAverageLoopTime()
void setAutoGcWindow(int windowMillis)
windowMillis
- minimal time milliseconds between calls.int getAutoGcWindow()
org.bytedeco.javacpp.Pointer allocate(long bytes, MemoryKind kind, boolean initialize)
bytes
- void release(org.bytedeco.javacpp.Pointer pointer, MemoryKind kind)
pointer
- kind
- void collect(INDArray... arrays)
arrays
- void purgeCaches()
void memcpy(DataBuffer dstBuffer, DataBuffer srcBuffer)
dstBuffer
- srcBuffer
- void memset(INDArray array)
array
- MemoryWorkspace scopeOutOfWorkspaces()
Copyright © 2017. All rights reserved.