public class DefaultMemoryManager extends java.lang.Object implements MemoryManager
MemoryManager.Type
Constructor and Description |
---|
DefaultMemoryManager() |
DefaultMemoryManager(long minMemoryInBytes,
long maxMemoryInBytes) |
Modifier and Type | Method and Description |
---|---|
void |
changeMemoryUsedBy(long memory)
Adds the provided memory value to existing memory usage.
|
boolean |
deregisterClient(java.lang.String registrationID)
Deregister a client with the given registrationID.
|
MemoryManager.Type |
getType() |
boolean |
isMemoryLow()
Checks if available memory is low.
|
java.util.Optional<java.lang.String> |
registerClient(MemoryManagerClient client)
Register a client with this memory manager.
|
public DefaultMemoryManager()
public DefaultMemoryManager(long minMemoryInBytes, long maxMemoryInBytes)
public MemoryManager.Type getType()
getType
in interface MemoryManager
public boolean isMemoryLow()
MemoryManager
MemoryManager.Type.SELF_MANAGED
instance types, otherwise it throws UnsupportedOperationException
isMemoryLow
in interface MemoryManager
public void changeMemoryUsedBy(long memory)
MemoryManager
MemoryManager.Type.SELF_MANAGED
instance types, otherwise it throws UnsupportedOperationException
changeMemoryUsedBy
in interface MemoryManager
public java.util.Optional<java.lang.String> registerClient(MemoryManagerClient client)
MemoryManager
MemoryManager.Type.JMX_BASED
instance types, otherwise it throws UnsupportedOperationException
registerClient
in interface MemoryManager
client
- client to registerpublic boolean deregisterClient(java.lang.String registrationID)
MemoryManager
MemoryManager.Type.JMX_BASED
instance types, otherwise it throws UnsupportedOperationException
deregisterClient
in interface MemoryManager
registrationID
- registration id of client to deregisterCopyright © 2012–2022 The Apache Software Foundation. All rights reserved.