|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectecologylab.appframework.Memory
public class Memory
Utility routines related to memory management, used to watch the JVM's consumption of memory, and to kick the garbage collector into action.
| Field Summary | |
|---|---|
static int |
DANGER_THRESHOLD
Less than this many bytes of memory free means danger, baby. |
static int |
gcCount
Number of times we've called gc(). |
static boolean |
isMicroshaftVM
|
| Constructor Summary | |
|---|---|
Memory()
|
|
| Method Summary | |
|---|---|
static long |
getFreeMemoryInBytes()
|
static java.lang.String |
getFreeMemoryInK()
|
static java.lang.String |
K(long numBytes)
|
static boolean |
outOfMemory(java.lang.Throwable throwable)
|
static void |
reclaim()
Prod the garbage collector, and print a message about memory status. |
static void |
reclaim(java.lang.String s)
Prod the garbage collector, and print a message about memory status. |
static boolean |
reclaimIfLow()
Try to reclaim memory if it seems to be in low supply. |
static void |
reclaimQuiet()
|
static void |
recover(java.lang.Throwable throwable,
java.lang.String msg)
|
static java.lang.String |
threads()
|
static java.lang.String |
usage()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DANGER_THRESHOLD
public static int gcCount
public static boolean isMicroshaftVM
| Constructor Detail |
|---|
public Memory()
| Method Detail |
|---|
public static void reclaim()
public static void reclaim(java.lang.String s)
s - Part of the message to be printed, to identify call site.public static void reclaimQuiet()
public static boolean reclaimIfLow()
public static void recover(java.lang.Throwable throwable,
java.lang.String msg)
public static java.lang.String usage()
public static java.lang.String K(long numBytes)
public static java.lang.String threads()
public static boolean outOfMemory(java.lang.Throwable throwable)
public static long getFreeMemoryInBytes()
public static java.lang.String getFreeMemoryInK()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||