|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.realtime.MemoryParameters
public class MemoryParameters
Jamaica Real-Time Specification for Java class MemoryParameters.
An instance of MemoryParameters can be associated with a schedulable object to describe and limit the memory allocation characteristics of this schedulable object. If a schedulable object exceeds the limits specified by its MemoryParameters, an OutOfMemoryError will be thrown on the allocation.
A memory parameters object that is shared by several schedulable objects does not mean that all those schedulable object will not exceed the allocation limits of this MemoryParameters object. Instead, the limits apply to each single schedulable object only.
NOTE: the methods in this class are not synchronized. They cannot be used by several threads simultaneously without proper explicit synchronization.
Field Summary | |
---|---|
static long |
NO_MAX
This value specifies no limit on the allocation budget. |
Constructor Summary | |
---|---|
MemoryParameters(long maxMemoryArea,
long maxImmortal)
Constructor to create a MemoryParameters with given maximum allocation budgets. |
|
MemoryParameters(long maxMemoryArea,
long maxImmortal,
long allocationRate)
Constructor to create a MemoryParameters with given maximum allocation budgets. |
Method Summary | |
---|---|
Object |
clone()
clone create a clone of this object with the same parameters but without association to any schedulable object |
long |
getAllocationRate()
getAllocationRate returns the current maximum allocation rate in bytes per second. |
long |
getMaxImmortal()
getMaxImmortal returns the current limit on the allocation allowed in the immortal memory area. |
long |
getMaxMemoryArea()
getMaxMemoryArea returns the limit on the allocation allowed in the initial memory area. |
void |
setAllocationRate(long allocationRate)
setAllocationRate sets the current maximum allocation rate in bytes per second. |
boolean |
setAllocationRateIfFeasible(long allocationRate)
setAllocationRateIfFeasible first checks if the schedulables associated with this would still be feasible with the new allocation rate. |
boolean |
setMaxImmortalIfFeasible(long maximum)
setMaxImmortalIfFeasible first checks if the schedulables associated with this would still be feasible with the new immortal allocation limit. |
boolean |
setMaxMemoryAreaIfFeasible(long maximum)
setMaxMemoryAreaIfFeasible first checks if the schedulables associated with this would still be feasible with the new allocation limit. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final long NO_MAX
Constructor Detail |
---|
public MemoryParameters(long maxMemoryArea, long maxImmortal) throws IllegalArgumentException
maxMemoryArea
- The limit on the allocation allowed in the
initial memory area. zero implies that no allocation is allowed,
NO_MAX does not restrict the amount of allocation.maxImmortal
- The limit on the allocation allowed in the
immortal memory area. zero implies that no allocation is allowed,
NO_MAX does not restrict the amount of allocation.
IllegalArgumentException
- if maxMemoryArea or maxImmortal
is negative and not NO_MAX.public MemoryParameters(long maxMemoryArea, long maxImmortal, long allocationRate) throws IllegalArgumentException
maxMemoryArea
- The limit on the allocation allowed in the
initial memory area. zero implies that no allocation is allowed,
NO_MAX does not restrict the amount of allocation.maxImmortal
- The limit on the allocation allowed in the
immortal memory area. zero implies that no allocation is allowed,
NO_MAX does not restrict the amount of allocation.allocationRate
- the maximum allocation rate in bytes per
second allowed on the heap. zero means no allocation is allowed
on the heap, NO_MAX means no limit on the allocation
rate. Measurement starts when the schedulable object is first
released. Enforcement of the allocation rate is an implementation
option and is not implemented for JamaicaVM. The garbage
collector of JamaicaVM is not paced, so it is not required to
restrict the allocation rate of the application to work properly.
IllegalArgumentException
- if maxMemoryArea, maxImmortal or
allocationRate is negative and not NO_MAX.Method Detail |
---|
public long getAllocationRate()
public long getMaxImmortal()
public long getMaxMemoryArea()
public void setAllocationRate(long allocationRate)
allocationRate
- the maximum allocation rate in bytes per
second allowed on the heap. zero means no allocation is allowed
on the heap, NO_MAX means no limit on the allocation
rate. Measurement starts when the schedulable object is first
released. Enforcement of the allocation rate is an implementation
option and is not implemented for JamaicaVM. The garbage
collector of JamaicaVM is not paced, so it is not required to
restrict the allocation rate of the application to work properly.
IllegalArgumentException
- if allocationRate is negative
and not NO_MAX.public boolean setMaxImmortalIfFeasible(long maximum)
maximum
- The limit on the allocation allowed in the
immortal memory area. zero implies that no allocation is allowed,
NO_MAX does not restrict the amount of allocation.
IllegalArgumentException
- if maximum is negative and not
NO_MAX.public boolean setMaxMemoryAreaIfFeasible(long maximum)
maximum
- The limit on the allocation allowed in the
initial memory area. zero implies that no allocation is allowed,
NO_MAX does not restrict the amount of allocation.
IllegalArgumentException
- if maximum is negative and not
NO_MAX.public boolean setAllocationRateIfFeasible(long allocationRate)
allocationRate
- the maximum allocation rate in bytes per
second allowed on the heap. zero means no allocation is allowed
on the heap, NO_MAX means no limit on the allocation
rate. Measurement starts when the schedulable object is first
released. Enforcement of the allocation rate is an implementation
option and it is not implemented for JamaicaVM. The garbage
collector of JamaicaVM is not paced, so it is not required to
restrict the allocation rate of the application to work properly.
IllegalArgumentException
- if allocationRate is negative
and not NO_MAX.public Object clone()
clone
in class Object
|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |