|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.realtime.MemoryParameters
Memory parameters can be given on the constructor of RealtimeThread
and AsyncEventHandler
. These can be used
both for the purposes of admission control by the scheduler and for
the purposes of pacing the garbage collector to satisfy all of the
thread allocation rates. When a reference to a
MemoryParameters
object is given as a parameter to a
constructor, the MemoryParameters
object becomes bound
to the object being created. Changes to the values in the
MemoryParameters object affect the constructed object. If given to
more than one constructor, then changes to the values in the
MemoryParameters
object affect all of the associated
objects. Note that this is a one-to- many relationship and not a
many-to-many.
Caution: This class is explicitly unsafe in multithreaded situations when it is being changed. No synchronization is done. It is assumed that users of this class who are mutating instances will be doing their own synchronization at a higher level.
Field Summary | |
protected long |
allocationRate
|
protected long |
maxImmortal
|
protected long |
maxMemoryArea
|
static long |
NO_MAX
Specifies no maximum limit for a given memory area. |
Constructor Summary | |
MemoryParameters(long maxMemoryArea,
long maxImmortal)
Create a MemoryParameters object with the given values. |
|
MemoryParameters(long maxMemoryArea,
long maxImmortal,
long allocationRate)
Creates a new MemoryParameters instance. |
Method Summary | |
long |
getAllocationRate()
Get the allocation rate. |
long |
getMaxImmortal()
Get the limit on the amount of memory the thread may allocate in the immortal area. |
void |
setAllocationRate(long allocationRate)
A limit on the rate of allocation in the heap. |
boolean |
setAllocationRateIfFeasible(int allocationRate)
Change the limit on the rate of allocation in the heap. |
boolean |
setMaxImmortalIfFeasible(long maxImmortal)
A limit on the amount of memory the thread may allocate in the immortal area. |
boolean |
setMaxMemoryAreaIfFeasible(long maxMemoryArea)
A limit on the amount of memory the thread may allocate in the memory area. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected long maxMemoryArea
protected long maxImmortal
protected long allocationRate
public static final long NO_MAX
Constructor Detail |
public MemoryParameters(long maxMemoryArea, long maxImmortal) throws IllegalArgumentException
maxMemoryArea
- A limit on the amount of memory the thread
may allocate in the memory area. Units are in bytes. If zero,
no allocation allowed in the memory area. To specify no limit,
use NO_MAX
or a value less than zero.maxImmortal
- A limit on the amount of memory the thread
may allocate in the immortal area. Units are in bytes. If zero,
no allocation allowed in immortal. To specify no limit, use
NO_MAX or a value less than zero.
IllegalArgumentException
public MemoryParameters(long maxMemoryArea, long maxImmortal, long allocationRate) throws IllegalArgumentException
MemoryParameters
instance.
maxMemoryArea
- A limit on the amount of memory the thread
may allocate in the memory area. Units are in bytes. If zero,
no allocation allowed in the memory area. To specify no limit,
use NO_MAX
or a value less than zero.maxImmortal
- A limit on the amount of memory the thread
may allocate in the immortal area. Units are in bytes. If zero,
no allocation allowed in immortal. To specify no limit, use
NO_MAX or a value less than zero.allocationRate
- A limit on the rate of allocation in the
heap. Units are in bytes per second. If zero, no allocation is
allowed in the heap. To specify no limit, use NO_MAX or a value
less than zero.
IllegalArgumentException
Method Detail |
public long getAllocationRate()
public void setAllocationRate(long allocationRate)
allocationRate
- Units are in bytes per second. If zero,
no allocation is allowed in the heap. To specify no limit, use
NO_MAX or a value less than zero.public boolean setAllocationRateIfFeasible(int allocationRate)
setAllocationRateIfFeasible
to return
false
.
allocationRate
- Units are in bytes per second. If zero,
no allocation is allowed in the heap. To specify no limit, use
NO_MAX
or a value less than zero.
true
if the request was fulfilled.public long getMaxImmortal()
public boolean setMaxImmortalIfFeasible(long maxImmortal)
maxImmortal
- Units are in bytes. If zero, no allocation
allowed in immortal. To specify no limit, use
NO_MAX
or a value less than zero.
public boolean setMaxMemoryAreaIfFeasible(long maxMemoryArea)
maxMemoryArea
- Units are in bytes. If zero, no allocation
allowed in the memory area. To specify no limit, use
NO_MAX
or a value less than zero.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |