public class MemoryUsage extends Object
Constructor and Description |
---|
MemoryUsage(long init,
long used,
long committed,
long max)
Constructs a new
MemoryUsage instance. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Compares the argument to the receiver, and answers true
if they represent the same object using a class
specific comparison.
|
static MemoryUsage |
from(CompositeData cd)
Receives a
CompositeData representing a MemoryUsage
object and attempts to return the root MemoryUsage
instance. |
long |
getCommitted()
Returns the amount of memory that has been pledged by the operating
system for the virtual machine to use.
|
long |
getInit()
Returns the initial amount of memory requested from the underlying
operating system when the virtual machine started up.
|
long |
getMax()
Returns the maximum amount of memory that is available to the virtual
machine which may change over the lifecycle of the virtual machine.
|
long |
getUsed()
Returns the number of bytes currently used for memory management
purposes.
|
int |
hashCode()
Answers an integer hash code for the receiver.
|
String |
toString()
Returns a text description of this memory usage.
|
public MemoryUsage(long init, long used, long committed, long max)
MemoryUsage
instance.init
- if defined, the initial amount of memory that can be allocated
by the virtual machine in bytes. If not defined, then
-1
.used
- the number of bytes currently used for memory.committed
- the number of bytes of committed memory.max
- if defined, the maximum number of bytes that can be used for
memory management purposes. If not defined, -1
.IllegalArgumentException
- if any of the following conditions applies:
init
< -1
max
< -1
used
< 0
committed
< 0
used
> committed
committed
> max
if
max
is not -1
.
public long getCommitted()
public long getInit()
if the initial memory size was not defined, this method will return a
value of -1
.
-1
if not defined.public long getMax()
-1
.public long getUsed()
public String toString()
public static MemoryUsage from(CompositeData cd)
CompositeData
representing a MemoryUsage
object and attempts to return the root MemoryUsage
instance.cd
- a CompositeDate
that represents a
MemoryUsage
.cd
is non- null
, returns a new
instance of MemoryUsage
. If cd
is
null
, returns null
.IllegalArgumentException
- if argument cd
does not correspond to a
MemoryUsage
with the following attributes all
of type java.long.Long
:
committed
init
max
used
public boolean equals(Object obj)
equals
in class Object
obj
- Object
the object to compare with this object.true
if the object is the same as this object
false
if it is different from this object.Object.hashCode()
public int hashCode()
true
when passed to
.equals
must answer the same value for this
method.hashCode
in class Object
Object.equals(java.lang.Object)
Eclipse OpenJ9 website.
To raise a bug report or suggest an improvement create an Eclipse OpenJ9 issue.
Copyright © 1993, 2023 IBM Corp. and others.