public class SimpleMemUsageReporter
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
SimpleMemUsageReporter.Snapshot
Convenience class for holding information about the heap
|
Constructor and Description |
---|
SimpleMemUsageReporter() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
formatMemStat(long value)
Static method for changing a long representing memory size to a human
friendly string
|
static java.lang.String |
formatTimeDiff(long timeDiff)
Used to convert the time difference between snapshots to a human readable
format
|
static void |
init()
Initialize values
|
static void |
main(java.lang.String[] args)
A simple test to make sure the output is sensible
|
static void |
print(SimpleMemUsageReporter.Snapshot snap)
Convenience printer
|
static void |
print(SimpleMemUsageReporter.Snapshot snap,
java.lang.String message)
Convenience printer with description
|
static void |
reset()
Reinitialize
|
static SimpleMemUsageReporter.Snapshot |
snapshot()
Takes a snapshot of the current heap
|
public static void init()
public static void reset()
public static SimpleMemUsageReporter.Snapshot snapshot()
public static void print(SimpleMemUsageReporter.Snapshot snap)
snap
- - the Snapshot to print to System.outpublic static void print(SimpleMemUsageReporter.Snapshot snap, java.lang.String message)
snap
- - the Snapshot to print to System.outmessage
- - the message to tack on for later identificationpublic static java.lang.String formatMemStat(long value)
value
- public static java.lang.String formatTimeDiff(long timeDiff)
timeDiff
- public static void main(java.lang.String[] args)
args
-