Dashboard Builder Commons 6.0.0.Final

org.jboss.dashboard.profiler.memory
Class MemoryProfiler

java.lang.Object
  extended by org.jboss.dashboard.profiler.memory.MemoryProfiler

@ApplicationScoped
public class MemoryProfiler
extends Object

The memory profiler provides information about the total and available memory of the underlying JVM running instance.


Field Summary
static String[] SIZE_UNITS
           
 
Constructor Summary
MemoryProfiler()
           
 
Method Summary
static String formatSize(long bytes)
           
protected  void freeEvenMoreMemory()
           
 MemoryProfiler freeMemory()
           
 long getFreeMemoryInBytes()
          Returns the amount of free memory in the Java Virtual Machine.
 long getMemoryUsedInBytes()
           
 float getMinMemoryPercentage()
           
 long getMinMemorySize()
           
 long getTotalMemoryInBytes()
          Returns the total amount of memory in the Java virtual machine.
 boolean isLowMemory()
           
static MemoryProfiler lookup()
           
 void setMinMemoryPercentage(float minMemoryPercentage)
           
 void setMinMemorySize(long minMemorySize)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SIZE_UNITS

public static final String[] SIZE_UNITS
Constructor Detail

MemoryProfiler

public MemoryProfiler()
Method Detail

lookup

public static MemoryProfiler lookup()

getMinMemorySize

public long getMinMemorySize()

setMinMemorySize

public void setMinMemorySize(long minMemorySize)

getMinMemoryPercentage

public float getMinMemoryPercentage()

setMinMemoryPercentage

public void setMinMemoryPercentage(float minMemoryPercentage)

isLowMemory

public boolean isLowMemory()

getFreeMemoryInBytes

public long getFreeMemoryInBytes()
Returns the amount of free memory in the Java Virtual Machine. Calling the gc method may result in increasing the value returned by freeMemory.

Returns:
an approximation to the total amount of memory currently available for future allocated objects, measured in bytes.

getTotalMemoryInBytes

public long getTotalMemoryInBytes()
Returns the total amount of memory in the Java virtual machine. The value returned by this method may vary over time, depending on the host environment.

Note that the amount of memory required to hold an object of any given type may be implementation-dependent.

Returns:
the total amount of memory currently available for current and future objects, measured in bytes.

freeMemory

public MemoryProfiler freeMemory()

freeEvenMoreMemory

protected void freeEvenMoreMemory()

getMemoryUsedInBytes

public long getMemoryUsedInBytes()

formatSize

public static String formatSize(long bytes)

Dashboard Builder Commons 6.0.0.Final

Copyright © 2012-2013 JBoss by Red Hat. All Rights Reserved.