@ApplicationScoped public class MemoryProfiler extends Object
Modifier and Type | Field and Description |
---|---|
static String[] |
SIZE_UNITS |
Constructor and Description |
---|
MemoryProfiler() |
Modifier and Type | Method and Description |
---|---|
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) |
public static final String[] SIZE_UNITS
public static MemoryProfiler lookup()
public long getMinMemorySize()
public void setMinMemorySize(long minMemorySize)
public float getMinMemoryPercentage()
public void setMinMemoryPercentage(float minMemoryPercentage)
public boolean isLowMemory()
public long getFreeMemoryInBytes()
gc
method may result in increasing the value returned
by freeMemory.
public long getTotalMemoryInBytes()
Note that the amount of memory required to hold an object of any given type may be implementation-dependent.
public MemoryProfiler freeMemory()
protected void freeEvenMoreMemory()
public long getMemoryUsedInBytes()
public static String formatSize(long bytes)
Copyright © 2012-2015 JBoss by Red Hat. All Rights Reserved.