public class MemoryUtils
extends java.lang.Object
Constructor and Description |
---|
MemoryUtils() |
Modifier and Type | Method and Description |
---|---|
static long |
availableMemoryBytes()
Returns the available heap size in bytes.
|
static long |
bytesToMebibytes(long bytes)
Converts the given memory size from bytes to mebibytes.
|
static void |
callGCMultipleTimes()
Call garbage collector 5 times explicitly.
|
static void |
callGCMultipleTimes(int times)
Call garbage collector explicitly.
|
static long |
maxMemoryBytes()
Returns the maximum heap size in bytes.
|
public static void callGCMultipleTimes()
public static void callGCMultipleTimes(int times)
times
- The number of calling garbage collectorpublic static long maxMemoryBytes()
public static long availableMemoryBytes()
public static long bytesToMebibytes(long bytes)
bytes
- A size of memory in bytes