| java.lang.Object org.apache.ivy.util.MemoryUtil
MemoryUtil | final public class MemoryUtil (Code) | | Memory related utilities.
|
Method Summary | |
public static long | getUsedMemory() Returns the currently used memory, after calling garbage collector and waiting enough to get
maximal chance it is actually called. | public static void | main(String[] args) | public static long | sizeOf(Class clazz) Returns the approximate size of a default instance of the given class.
Parameters: clazz - the class to evaluate. |
getUsedMemory | public static long getUsedMemory()(Code) | | Returns the currently used memory, after calling garbage collector and waiting enough to get
maximal chance it is actually called. But since
Runtime.gc is only advisory,
results returned by this method should be treated as rough approximation only.
the currently used memory, in bytes. |
sizeOf | public static long sizeOf(Class clazz)(Code) | | Returns the approximate size of a default instance of the given class.
Parameters: clazz - the class to evaluate. the estimated size of instance, in bytes. |
|
|