|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.h2.util.MemoryUtils
public class MemoryUtils
This is a utility class with functions to measure the free and used memory.
| Field Summary | |
|---|---|
static byte[] |
EMPTY_BYTES
An 0-size byte array. |
static int[] |
EMPTY_INT_ARRAY
An 0-size int array. |
static long[] |
EMPTY_LONG_ARRAY
An 0-size long array. |
| Method Summary | |
|---|---|
static void |
allocateReserveMemory()
Allocate a little main memory that is freed up when if no memory is available, so that rolling back a large transaction is easier. |
static boolean |
freeReserveMemory()
Free up the reserve memory. |
static int |
getMemoryFree()
Get the free memory in KB. |
static int |
getMemoryUsed()
Get the used memory in KB. |
static byte[] |
newBytes(int len)
Create an array of bytes with the given size. |
static int[] |
newIntArray(int len)
Create an int array with the given size. |
static long[] |
newLongArray(int len)
Create a long array with the given size. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final byte[] EMPTY_BYTES
public static final int[] EMPTY_INT_ARRAY
public static final long[] EMPTY_LONG_ARRAY
| Method Detail |
|---|
public static int getMemoryUsed()
public static int getMemoryFree()
public static void allocateReserveMemory()
public static boolean freeReserveMemory()
public static byte[] newBytes(int len)
len - the number of bytes requested
java.lang.OutOfMemoryErrorpublic static int[] newIntArray(int len)
len - the number of bytes requested
public static long[] newLongArray(int len)
len - the number of bytes requested
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||