org.jboss.dashboard.profiler.memory
Class MemoryProfiler
java.lang.Object
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.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SIZE_UNITS
public static final String[] SIZE_UNITS
MemoryProfiler
public MemoryProfiler()
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)
Copyright © 2012-2015 JBoss by Red Hat. All Rights Reserved.