public class BufferingManager extends Object implements Closeable, IMemoryManageable
BufferedIOIMemoryManageable.FreeMemoryLevel| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_MAX_MEMORY
By default set to 64MB.
|
static int |
DEFAULT_MEMORY_THRESHOLD
By default set to 55MB.
|
static int |
DEFAULT_TO_BE_WRITTEN_THRESHOLD
By default set to 12MB.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
freeMemory(IMemoryManageable.FreeMemoryLevel level)
Request to free some memory.
|
static BufferingManager |
get()
Return the instance associated with the current Application.
|
String |
getDescription()
Desciption.
|
List<String> |
getItemsDescription()
Describe each item that can be freed.
|
long |
getMaxMemory() |
long |
getMemoryThreshold() |
long |
getToBeWrittenThreshold() |
void |
setMemoryLimits(long memoryThreshold,
long maxMemory,
long toBeWrittenThreshold)
Set the memory limits.
|
public static final int DEFAULT_MEMORY_THRESHOLD
public static final int DEFAULT_MAX_MEMORY
public static final int DEFAULT_TO_BE_WRITTEN_THRESHOLD
public static BufferingManager get()
public long getMemoryThreshold()
public long getMaxMemory()
public long getToBeWrittenThreshold()
public void setMemoryLimits(long memoryThreshold,
long maxMemory,
long toBeWrittenThreshold)
memoryThreshold - when this threshold is reached, it accelerates freeing some memorymaxMemory - maximum memory to usetoBeWrittenThreshold - when this threshold is reached, pending writes are executedpublic void close()
close in interface Closeableclose in interface AutoCloseablepublic String getDescription()
IMemoryManageablegetDescription in interface IMemoryManageablepublic List<String> getItemsDescription()
IMemoryManageablegetItemsDescription in interface IMemoryManageablepublic void freeMemory(IMemoryManageable.FreeMemoryLevel level)
IMemoryManageablefreeMemory in interface IMemoryManageableCopyright © 2018. All rights reserved.