public class MemoryInfo
extends java.lang.Object
For example, the space that is being currently used is calculated with the following expression.
getXXXTotalMemory()-getXXXFreeMemory()
Note:XXX expresses one of Eden,Survivor,Tenured,Metaspace.
| Modifier and Type | Method and Description |
|---|---|
static long |
getEdenFreeMemory()
Acquires the free space in the Eden area.
|
static long |
getEdenMaxMemory()
Acquires the maximum space used by the Eden area.
|
static long |
getEdenTotalMemory()
Acquires the commited space in the Eden area.
|
static long |
getMetaspaceFreeMemory()
Acquires the free space in the Metaspace.
|
static long |
getMetaspaceMaxMemory()
Acquires the maximum space used by the Metaspace.
|
static long |
getMetaspaceTotalMemory()
Acquires the commited space in the Metaspace.
|
static long |
getPermFreeMemory()
Deprecated.
For version 10-10 or later, we recommend that you use
getMetaspaceFreeMemory(). |
static long |
getPermMaxMemory()
Deprecated.
For version 10-10 or later, we recommend that you use
getMetaspaceMaxMemory(). |
static long |
getPermTotalMemory()
Deprecated.
For version 10-10 or later, we recommend that you use
getMetaspaceTotalMemory(). |
static long |
getSurvivorFreeMemory()
Acquires the free space in the Survivor area.
|
static long |
getSurvivorMaxMemory()
Acquires the maximum space used by the Survivor area.
|
static long |
getSurvivorTotalMemory()
Acquires the commited space in the Survivor area.
|
static long |
getTenuredFreeMemory()
Acquires the free space in the Tenured area.
|
static long |
getTenuredMaxMemory()
Acquires the maximum space used by the Tenured area.
|
static long |
getTenuredTotalMemory()
Acquires the commited space in the Tenured area.
|
public static long getEdenFreeMemory()
public static long getEdenTotalMemory()
public static long getEdenMaxMemory()
Note:If the G1GC is used, -1 is returned.
public static long getSurvivorFreeMemory()
public static long getSurvivorTotalMemory()
public static long getSurvivorMaxMemory()
Note:If the G1GC is used, -1 is returned.
public static long getTenuredFreeMemory()
public static long getTenuredTotalMemory()
public static long getTenuredMaxMemory()
Note:If the G1GC is used, the maximum space used by the Java Heap is returned.
public static long getPermFreeMemory()
getMetaspaceFreeMemory().getMetaspaceFreeMemory()public static long getPermTotalMemory()
getMetaspaceTotalMemory().getMetaspaceTotalMemory()public static long getPermMaxMemory()
getMetaspaceMaxMemory().getMetaspaceMaxMemory()public static long getMetaspaceFreeMemory()
public static long getMetaspaceTotalMemory()
public static long getMetaspaceMaxMemory()
Note:If the MaxMetaspaceSize option is not specified, the method returns -1.
Copyright (C) 2015, Hitachi, Ltd.
Copyright (C) 2013, Oracle and/or its affiliates. All rights reserved.