public class MemoryUsage extends Usage<MemoryUsage>
name, parent, percentUsage, usageLock, waitForSpaceCondition
Constructor and Description |
---|
MemoryUsage() |
MemoryUsage(MemoryUsage parent)
Create the memory manager linked to a parent.
|
MemoryUsage(MemoryUsage parent,
String name) |
MemoryUsage(MemoryUsage parent,
String name,
float portion) |
MemoryUsage(String name) |
Modifier and Type | Method and Description |
---|---|
void |
decreaseUsage(long value)
Decreases the usage by the value amount.
|
void |
enqueueUsage(long value)
Tries to increase the usage by value amount but blocks if this object is
currently full.
|
long |
getUsage() |
void |
increaseUsage(long value)
Increases the usage by the value amount.
|
boolean |
isFull() |
protected long |
retrieveUsage() |
void |
setPercentOfJvmHeap(int percentOfJvmHeap) |
void |
setUsage(long usage) |
void |
waitForSpace() |
boolean |
waitForSpace(long timeout) |
addChild, addUsageListener, caclPercentUsage, getExecutor, getLimit, getLimiter, getName, getNumUsageListeners, getParent, getPercentUsage, getPercentUsageMinDelta, getPollingTime, getUsagePortion, isFull, isStarted, notifyCallbackWhenNotFull, onLimitChange, removeChild, removeUsageListener, setExecutor, setLimit, setLimiter, setName, setParent, setPercentUsage, setPercentUsageMinDelta, setPollingTime, setUsagePortion, start, stop, toString, waitForSpace
public MemoryUsage()
public MemoryUsage(MemoryUsage parent)
parent
- public MemoryUsage(String name)
public MemoryUsage(MemoryUsage parent, String name)
public MemoryUsage(MemoryUsage parent, String name, float portion)
public void waitForSpace() throws InterruptedException
waitForSpace
in class Usage<MemoryUsage>
InterruptedException
public boolean waitForSpace(long timeout) throws InterruptedException
waitForSpace
in class Usage<MemoryUsage>
timeout
- InterruptedException
public boolean isFull()
isFull
in class Usage<MemoryUsage>
public void enqueueUsage(long value) throws InterruptedException
value
- InterruptedException
public void increaseUsage(long value)
value
- public void decreaseUsage(long value)
value
- protected long retrieveUsage()
retrieveUsage
in class Usage<MemoryUsage>
public long getUsage()
getUsage
in class Usage<MemoryUsage>
public void setUsage(long usage)
public void setPercentOfJvmHeap(int percentOfJvmHeap)
Copyright © 2005–2019 The Apache Software Foundation. All rights reserved.