jrockit.management
Interface MemoryMXBean

All Superinterfaces:
java.lang.management.MemoryMXBean

public interface MemoryMXBean
extends java.lang.management.MemoryMXBean

This interface exposes memory-specific information. It is a JRockit-specific extension of java.lang.management.MemoryMXBean.

Author:
Marcus Hirt

Method Summary
 long getAllocatedHeapSize()
          Returns the size of the heap that the JVM has allocated, in bytes.
 long getTotalPhysicalMemory()
          Returns the total physical memory, in bytes.
 long getUsedPhysicalMemory()
          Returns the committed heap size of the JVM in bytes.
 boolean isExitOnOutOfMemory()
          Returns true if the JVM will exit with an error code instead of throwing an OutOfMemoryError, false if it throws an OutOfMemoryError.
 boolean isHeapSizeLocked()
          This method returns false if the heap size is controlled by the JVM, false otherwise.
 void setAllocatedHeapSize(long heapSize)
          This method will suggest the heapsize to be used.
 void setExitOnOutOfMemory(boolean exitOnOOM)
          This method will change whether the JVM will exit with an error code, instead of throwing an OutOfMemoryError.
 void setHeapSizeLocked(boolean locked)
          This method changes the JVM's ability to adaptively change the heap size.
 
Methods inherited from interface java.lang.management.MemoryMXBean
gc, getHeapMemoryUsage, getNonHeapMemoryUsage, getObjectPendingFinalizationCount, isVerbose, setVerbose
 

Method Detail

isExitOnOutOfMemory

boolean isExitOnOutOfMemory()
Returns true if the JVM will exit with an error code instead of throwing an OutOfMemoryError, false if it throws an OutOfMemoryError. (@see OutOfMemoryError)

Default is false.

Returns:
true if the JVM will exit with an error code instead of throwing an OutOfMemoryError, false if it throws an OutOfMemoryError.

setExitOnOutOfMemory

void setExitOnOutOfMemory(boolean exitOnOOM)
                          throws java.lang.SecurityException
This method will change whether the JVM will exit with an error code, instead of throwing an OutOfMemoryError. (@see OutOfMemoryError)

In the case of JRockit, the exit code will be 72.

Parameters:
exitOnOOM - if true, the JVM will exit when out of memory, if false, it will throw an OutOfMemoryError.
Throws:
SecurityPermission - if you don't have the control permission set.
java.lang.SecurityException

setHeapSizeLocked

void setHeapSizeLocked(boolean locked)
                       throws java.lang.SecurityException
This method changes the JVM's ability to adaptively change the heap size.

Parameters:
locked - if true, the heap size will no longer be changed by the JVM, if false, the JVM is in control over the heap size.
Throws:
SecurityPermission - if you don't have the control permission set.
java.lang.SecurityException

isHeapSizeLocked

boolean isHeapSizeLocked()
This method returns false if the heap size is controlled by the JVM, false otherwise.

Returns:
false if the heap size is controlled by the JVM, true if it has been frozen to its current value.
Throws:
SecurityPermission - if you don't have the control permission set.

setAllocatedHeapSize

void setAllocatedHeapSize(long heapSize)
                          throws java.lang.SecurityException
This method will suggest the heapsize to be used. The method may trigg a full GC if needed for changing the heap size. The actual obtained heap size may differ from the suggested heap size for a number of reasons, for instance address alignment, not enough available memory, the suggested size is too small to fit the currently used heap or larger than the specified maximum heap size etc.

Parameters:
heapSize - the wanted heap size.
Throws:
SecurityPermission - if you don't have the control permission set.
java.lang.SecurityException

getAllocatedHeapSize

long getAllocatedHeapSize()
Returns the size of the heap that the JVM has allocated, in bytes.

Returns:
the allocated heap size of the JVM in bytes.
Throws:
SecurityPermission - if you don't have the control permission set.

getUsedPhysicalMemory

long getUsedPhysicalMemory()
Returns the committed heap size of the JVM in bytes.

Returns:
the committed heap size of JVM in bytes.

getTotalPhysicalMemory

long getTotalPhysicalMemory()
Returns the total physical memory, in bytes.

Returns:
the total physical memory.


Copyright © 2004-2005 BEA Systems Inc.