public class HeapConstraint extends ResourceConstraint<HeapConstraint>
Constructor and Description |
---|
HeapConstraint(RealtimeThreadGroup group,
long budget)
Create a new contraint for the given RealtimeThreadGroup.
|
Modifier and Type | Method and Description |
---|---|
long |
available()
Determine how much of the resource are available for use, i.e., the
amount of the limit minus amount lent.
|
static HeapConstraint |
currentConstraint()
Determine the Heap constraint for the current execution context.
|
static HeapConstraint |
currentConstraint(java.lang.Thread thread)
Determine the processing constraint for the give execution context.
|
static HeapConstraint |
currentConstraint(java.lang.ThreadGroup group)
Determine the processing constraint for the give execution context.
|
protected void |
finalize() |
long |
getBudget()
Determine the total amount of a memory under the control of this
resource constraint instance.
|
static HeapConstraint |
getRootConstraint()
Get the root instance for this constraint type.
|
void |
start()
Start applying this constraint to is tasks.
|
void |
stop()
Stop applying this constraint to is tasks.
|
long |
used()
Determine how much of the resource have been used of the amount available.
|
void |
visit(java.util.function.Consumer<javax.realtime.enforce.HeapConstraint.TracingReference> consumer) |
getNotificationHandler, getParent, getRealtimeThreadGroup, governs, governs, governs, isEnforcing, setNotificationHandler, visitBorrowers, visitGoverned
public HeapConstraint(RealtimeThreadGroup group, long budget)
group
- The RealtimeThreadGroup
to govern.budget
- the amount of memory to take from its parent to manage.public static HeapConstraint getRootConstraint()
public static HeapConstraint currentConstraint()
public static HeapConstraint currentConstraint(java.lang.Thread thread)
thread
- The given execution context.public static HeapConstraint currentConstraint(java.lang.ThreadGroup group)
group
- The given execution context.protected void finalize() throws java.lang.Throwable
finalize
in class ResourceConstraint<HeapConstraint>
java.lang.Throwable
public void start()
start
in class ResourceConstraint<HeapConstraint>
public void stop()
stop
in class ResourceConstraint<HeapConstraint>
public long getBudget()
public long used()
public long available()
public void visit(java.util.function.Consumer<javax.realtime.enforce.HeapConstraint.TracingReference> consumer)
aicas GmbH, Karlsruhe, Germany —www.aicas.com
Copyright © 2001-2024 aicas GmbH. All Rights Reserved.