public class LTMemory extends ScopedMemory
LTMemory
.
In JamaicaVM, the memory space for this LTMemory area is allocated from the
Java heap (HeapMemory), i.e., it is not depending on an external memory
source such as a call to the C function malloc()
. This implies
that the creation of an LTMemory
may fail if the available
memory on the Java heap is low.
Constructor and Description |
---|
LTMemory(long sizeInBytes)
Equivalent to
LTMemory(long, long, Runnable) with the argument
list (sizeInBytes, sizeInBytes, null) . |
LTMemory(long initialSizeInBytes,
long maxSizeInBytes)
Equivalent to
LTMemory(long, long, Runnable) with the argument
list (initialSizeInBytes, maxSizeInBytes, null) . |
LTMemory(long initialSizeInBytes,
long maxSizeInBytes,
Runnable logic)
Creates an
LTMemory of the given size. |
LTMemory(long sizeInBytes,
Runnable logic)
Equivalent to
LTMemory(long, long, Runnable) with the argument
list (sizeInBytes, sizeInBytes, logic) . |
LTMemory(SizeEstimator size)
Equivalent to
LTMemory(long, long, Runnable) with the argument
list (size.getEstimate(), size.getEstimate(), null) . |
LTMemory(SizeEstimator size,
Runnable logic)
Equivalent to
LTMemory(long, long, Runnable) with the argument
list (size.getEstimate(), size.getEstimate(), logic) . |
LTMemory(SizeEstimator initial,
SizeEstimator maximum)
Equivalent to
LTMemory(long, long, Runnable) with the argument
list (initial.getEstimate(), maximum.getEstimate(), null) . |
LTMemory(SizeEstimator initial,
SizeEstimator maximum,
Runnable logic)
Equivalent to
LTMemory(long, long, Runnable) with the argument
list (initial.getEstimate(), maximum.getEstimate(), logic) . |
Modifier and Type | Method and Description |
---|---|
String |
toString()
Creates a string representation of this object.
|
enter, enter, executeInArea, getMaximumSize, getPortal, getReferenceCount, join, join, joinAndEnter, joinAndEnter, joinAndEnter, joinAndEnter, memoryConsumed, memoryRemaining, newArray, newInstance, newInstance, setPortal, size
enter, enter, enter, enter, enter, executeInArea, executeInArea, executeInArea, executeInArea, executeInArea, getMemoryArea, mayHoldReferenceTo, mayHoldReferenceTo, newArrayInArea
public LTMemory(long initialSizeInBytes, long maxSizeInBytes)
LTMemory(long, long, Runnable)
with the argument
list (initialSizeInBytes, maxSizeInBytes, null)
.
In JamaicaVM, the size of an LTMemory is not increased dynamically. If the initial size is less than maxSizeInBytes, it will be set to maxSizeInBytes.
IllegalArgumentException
- when initialSizeInBytes
is
greater than maxSizeInBytes
,
or when initial
or maxSizeInBytes
is less than zero.OutOfMemoryError
- when there is insufficient memory for
the LTMemory
object or for
the backing memory.UnsupportedOperationException
- In JamaicaVM when a user-defined
subclass does not know about the
memory area implementation details.initialSizeInBytes
- The size in bytes of the memory to allocate for
this area. This memory must be committed before
the completion of the constructor.maxSizeInBytes
- The size in bytes of the memory to allocate for
this area.public LTMemory(long initialSizeInBytes, long maxSizeInBytes, Runnable logic)
LTMemory
of the given size.
In JamaicaVM, the size of an LTMemory
is not increased dynamically.
If the initial size is less than maxSizeInBytes
, it will be set to
maxSizeInBytes.
IllegalArgumentException
- when initialSizeInBytes
is
greater than maxSizeInBytes
,
or when initialSizeInBytes
or
maxSizeInBytes
is less than
zero.OutOfMemoryError
- when there is insufficient memory for
the LTMemory
object or for
the backing memory.IllegalAssignmentError
- when storing logic
in this
would violate the assignment
rules.UnsupportedOperationException
- In JamaicaVM when a user-defined
subclass does not know about the
memory area implementation details.initialSizeInBytes
- The size in bytes of the memory to allocate for
this area. This memory must be committed before
the completion of the constructor.maxSizeInBytes
- The size in bytes of the memory to allocate for
this area.logic
- The run()
of the given Runnable
will be executed using this
as its
initial memory area. When logic
is
null
, this constructor is equivalent to
LTMemory(long initial, long maximum)
.public LTMemory(SizeEstimator initial, SizeEstimator maximum)
LTMemory(long, long, Runnable)
with the argument
list (initial.getEstimate(), maximum.getEstimate(), null)
.
In JamaicaVM, the size of an LTMemory
is not increased dynamically.
If the initial size is less than maxSizeInBytes
, it will be set to
maxSizeInBytes.
IllegalArgumentException
- when initial
is null
,
maximum
is null
,
initial.getEstimate()
is
greater than maximum.getEstimate()
,
or when initial.getEstimate()
is less than zero.OutOfMemoryError
- when there is insufficient memory for
the LTMemory
object or for
the backing memory.UnsupportedOperationException
- In JamaicaVM when a user-defined
subclass does not know about the
memory area implementation details.initial
- An instance of SizeEstimator
used to give an
estimate of the initial size. This memory must be committed
before the completion of the constructor.maximum
- An instance of SizeEstimator
used to give an
estimate for the maximum bytes to allocate for this area.public LTMemory(SizeEstimator initial, SizeEstimator maximum, Runnable logic)
LTMemory(long, long, Runnable)
with the argument
list (initial.getEstimate(), maximum.getEstimate(), logic)
.
In JamaicaVM, the size of an LTMemory is not increased dynamically. If the initial size is less than maxSizeInBytes, it will be set to maxSizeInBytes.
IllegalArgumentException
- when initial
is null
,
maximum
is null
,
initial.getEstimate()
is
greater than maximum.getEstimate()
,
or when initial.getEstimate()
is less than zero.OutOfMemoryError
- when there is insufficient memory for
the LTMemory
object or for
the backing memory.IllegalAssignmentError
- when storing logic
in this
would violate the assignment
rules.UnsupportedOperationException
- In JamaicaVM when a user-defined
subclass does not know about the
memory area implementation details.initial
- An instance of SizeEstimator
used to give an
estimate of the initial size. This memory must be committed
before the completion of the constructor.maximum
- An instance of SizeEstimator
used to give an
estimate for the maximum bytes to allocate for this area.logic
- The run()
of the given Runnable
will be
executed using this
as its initial memory area. When
logic
is null
, this constructor is
equivalent to LTMemory(SizeEstimator initial,
SizeEstimator maximum)
.public LTMemory(long sizeInBytes)
LTMemory(long, long, Runnable)
with the argument
list (sizeInBytes, sizeInBytes, null)
.IllegalArgumentException
- when sizeInBytes
is less than
zero.OutOfMemoryError
- when there is insufficient memory for
the LTMemory
object or for
the backing memory.UnsupportedOperationException
- In JamaicaVM when a user-defined
subclass does not know about the
memory area implementation details.sizeInBytes
- The size in bytes of the memory to allocate for this
area. This memory must be committed before the
completion of the constructor.public LTMemory(long sizeInBytes, Runnable logic)
LTMemory(long, long, Runnable)
with the argument
list (sizeInBytes, sizeInBytes, logic)
.IllegalArgumentException
- when sizeInBytes
is less than
zero.OutOfMemoryError
- when there is insufficient memory for
the LTMemory
object or for
the backing memory.IllegalAssignmentError
- when storing logic
in this
would violate the assignment
rules.UnsupportedOperationException
- In JamaicaVM when a user-defined
subclass does not know about the
memory area implementation details.sizeInBytes
- The size in bytes of the memory to allocate for this
area. This memory must be committed before the
completion of the constructor.logic
- The run()
of the given Runnable
will be
executed using this
as its initial memory area.
When logic
is null
, this constructor is
equivalent to LTMemory(long sizeInBytes)
.public LTMemory(SizeEstimator size)
LTMemory(long, long, Runnable)
with the argument
list (size.getEstimate(), size.getEstimate(), null)
.IllegalArgumentException
- when size
is null
, or
size.getEstimate()
is less
than zero.OutOfMemoryError
- when there is insufficient memory for
the LTMemory
object or for
the backing memory.UnsupportedOperationException
- In JamaicaVM when a user-defined
subclass does not know about the
memory area implementation details.size
- An instance of SizeEstimator
used to give an estimate
of the initial size. This memory must be committed before the
completion of the constructor.public LTMemory(SizeEstimator size, Runnable logic)
LTMemory(long, long, Runnable)
with the argument
list (size.getEstimate(), size.getEstimate(), logic)
.IllegalArgumentException
- when size
is null
, or
size.getEstimate()
is less
than zero.OutOfMemoryError
- when there is insufficient memory for
the LTMemory
object or for
the backing memory.IllegalAssignmentError
- when storing logic
in this
would violate the assignment
rules.UnsupportedOperationException
- In JamaicaVM when a user-defined
subclass does not know about the
memory area implementation details.size
- An instance of SizeEstimator
used to give an estimate
of the initial size. This memory must be committed before the
completion of the constructor.logic
- The run()
of the given Runnable
will be
executed using this
as its initial memory area. When
logic
is null
, this constructor is equivalent
to LTMemory(SizeEstimator size)
.public String toString()
(LTMemory) ScopedMemory#<num>
where <num>
uniquely identifies the LTMemory
area.toString
in class ScopedMemory
this
.aicas GmbH, Karlsruhe, Germany —www.aicas.com
Copyright © 2001-2019 aicas GmbH. All Rights Reserved.