public final class MemoryQuota extends Object
Constructor and Description |
---|
MemoryQuota()
Returns the memory quota reservation system for this server instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
acquireMemory(long size)
Reserves the requested amount of memory in OldGen.
|
long |
getAvailableMemory()
Returns how much memory is currently not reserved (free) in OldGen.
|
long |
getMaxMemory()
Returns the maximum amount of memory the server will use when giving quotas.
|
boolean |
isMemoryAvailable(long size)
Check enough memory is available in the reservable pool.
|
int |
memBytesToPercent(long size)
Translates bytes to percent of reservable memory.
|
long |
memPercentToBytes(int percent)
Translates a percentage of memory to the equivalent number of bytes.
|
void |
releaseMemory(long size)
Declares OldGen memory is not needed anymore.
|
public MemoryQuota()
public long getMaxMemory()
public boolean isMemoryAvailable(long size)
size
- the amount of requested memorypublic boolean acquireMemory(long size)
size
- the requested amount of memory in bytespublic long getAvailableMemory()
public int memBytesToPercent(long size)
size
- the amount of memory in bytespublic long memPercentToBytes(int percent)
percent
- a percentage of memorypublic void releaseMemory(long size)
size
- the amount of memory to returnCopyright © 2010-2017 ForgeRock AS. All Rights Reserved.