public 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 sizeInBytes)
Reserves the requested amount of memory in OldGen.
|
long |
getAvailableMemory()
Returns how much memory is currently not reserved (free) in OldGen (in bytes).
|
long |
getReservableMemory()
Returns the amount of reservable memory in bytes.
|
boolean |
isMemoryAvailable(long sizeInBytes)
Check enough memory is available in the reservable pool.
|
int |
memBytesToPercent(long sizeInBytes)
Translates bytes to percent of reservable memory.
|
long |
memPercentToBytes(int percent)
Translates a percentage of reservable memory to the equivalent number of bytes.
|
void |
releaseMemory(long sizeInBytes)
Declares OldGen memory is not needed anymore.
|
public MemoryQuota()
public long getReservableMemory()
public boolean isMemoryAvailable(long sizeInBytes)
sizeInBytes
- the amount of requested memory (in bytes)public boolean acquireMemory(long sizeInBytes)
sizeInBytes
- the requested amount of memory (in bytes)public long getAvailableMemory()
public int memBytesToPercent(long sizeInBytes)
sizeInBytes
- the amount of memory (in bytes)public long memPercentToBytes(int percent)
percent
- a percentage of reservable memorypublic void releaseMemory(long sizeInBytes)
sizeInBytes
- the amount of memory to return (in bytes)Copyright 2010-2022 ForgeRock AS.