public abstract class MemoryBudget extends AllocationHandler
Constructor and Description |
---|
MemoryBudget(Thread t,
long budget)
Add a budget for a given thread
|
Modifier and Type | Method and Description |
---|---|
boolean |
allocationPermitted()
Is allocation within thread() still permitted?
|
void |
allowAllocation()
Permit allocation for this thread.
|
long |
budget()
Get the budget of a given thread
|
abstract void |
budgetEmpty()
Handler routine that is called when the budget of a certain
thread is exhausted.
|
void |
destroy()
Remove this memory budget from thread().
|
void |
forbidAllocation()
Forbid allocation for this thread.
|
Object |
handle(Object o)
Routine that will be called when a thread allocated an object.
|
Thread |
thread()
The thread this budget is assigned to
|
long |
usedBudget()
Get the used budget of a given thread
|
getObjectSize, partialGC, removeAllocationHandler, setAllocationHandler
public MemoryBudget(Thread t, long budget)
t
- the threadbudget
- the budget in bytespublic long budget()
public long usedBudget()
public Thread thread()
public boolean allocationPermitted()
public final Object handle(Object o)
handle
in class AllocationHandler
o
- the allocated objectpublic void forbidAllocation()
public void allowAllocation()
public abstract void budgetEmpty()
public void destroy()
aicas GmbH, Karlsruhe, Germany —www.aicas.com
Copyright © 2001-2022 aicas GmbH. All Rights Reserved.