public class MemorySpy
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
MemorySpy.MemScope |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CURRENT |
static java.lang.String |
FREE |
static java.lang.String |
TOTAL |
| Constructor and Description |
|---|
MemorySpy() |
| Modifier and Type | Method and Description |
|---|---|
long |
getCurrentMem()
get the currently used memory
|
long |
getFreeMem() |
long |
getHeapUsed(MemorySpy.MemScope scope) |
long |
getMemFromPool(java.lang.String name,
MemorySpy.MemScope scope) |
long |
getNonHeapUsed(MemorySpy.MemScope scope) |
long |
getPermGen(MemorySpy.MemScope scope) |
java.util.Map<java.lang.String,java.lang.Long> |
getSizeMap() |
java.lang.String |
getSummary()
get a fast summary for debugging
|
java.lang.String |
getSummary(java.lang.String delim)
get a fast summary for debugging
|
java.util.Map<java.lang.String,java.lang.Long> |
getSummaryMap()
get a fast summary for debugging
|
long |
getTotalMemory() |
static boolean |
isDefaultMega() |
boolean |
isWantMega() |
static void |
setDefaultMega(boolean defaultMega) |
void |
setWantMega(boolean wantMega)
if true we want it in Megabytes
|
java.lang.String |
toString() |
public static final java.lang.String CURRENT
public static final java.lang.String TOTAL
public static final java.lang.String FREE
public static boolean isDefaultMega()
public static void setDefaultMega(boolean defaultMega)
defaultMega - the defaultMega to setpublic java.util.Map<java.lang.String,java.lang.Long> getSizeMap()
public long getHeapUsed(MemorySpy.MemScope scope)
scope - public long getNonHeapUsed(MemorySpy.MemScope scope)
scope - public long getPermGen(MemorySpy.MemScope scope)
scope - public long getMemFromPool(java.lang.String name,
MemorySpy.MemScope scope)
name - scope - public java.lang.String getSummary(java.lang.String delim)
public java.lang.String getSummary()
public long getCurrentMem()
public java.util.Map<java.lang.String,java.lang.Long> getSummaryMap()
public long getTotalMemory()
public long getFreeMem()
public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()public boolean isWantMega()
public void setWantMega(boolean wantMega)
wantMega -