public abstract class MemoryManager
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.util.concurrent.atomic.AtomicLong |
MEM_ALLOC |
static long |
MEM_MAX |
Constructor and Description |
---|
MemoryManager() |
Modifier and Type | Method and Description |
---|---|
static byte[] |
arrayCopyOf(byte[] orig,
int sz) |
static double[] |
arrayCopyOf(double[] orig,
int sz) |
static int[] |
arrayCopyOf(int[] orig,
int sz) |
static long[] |
arrayCopyOf(long[] orig,
int sz) |
static byte[] |
arrayCopyOfRange(byte[] orig,
int from,
int sz) |
static double[] |
arrayCopyOfRange(double[] orig,
int from,
int sz) |
static int[] |
arrayCopyOfRange(int[] orig,
int from,
int sz) |
static long[] |
arrayCopyOfRange(long[] orig,
int from,
int sz) |
static boolean |
canAlloc() |
static void |
freeTaskMem(long m)
Free the memory successfully reserved by task.
|
static java.lang.Object |
malloc(int elems,
long bytes,
int type,
java.lang.Object orig,
int from) |
static java.lang.Object |
malloc(int elems,
long bytes,
int type,
java.lang.Object orig,
int from,
boolean force) |
static byte[] |
malloc1(int size) |
static byte[] |
malloc1(int size,
boolean force) |
static short[] |
malloc2(int size) |
static int[] |
malloc4(int size) |
static float[] |
malloc4f(int size) |
static long[] |
malloc8(int size) |
static double[] |
malloc8d(int size) |
static boolean[] |
mallocZ(int size) |
static void |
reserveTaskMem(long m) |
static void |
set_goals(java.lang.String msg,
boolean oom) |
static void |
set_goals(java.lang.String msg,
boolean oom,
long bytes) |
static void |
setMemGood() |
static void |
setMemLow() |
static boolean |
tryReserveTaskMem(long m)
Try to reserve memory needed for task execution and return true if
succeeded.
|
public static final long MEM_MAX
public static final java.util.concurrent.atomic.AtomicLong MEM_ALLOC
public static void setMemGood()
public static void setMemLow()
public static boolean canAlloc()
public static void set_goals(java.lang.String msg, boolean oom)
public static void set_goals(java.lang.String msg, boolean oom, long bytes)
public static java.lang.Object malloc(int elems, long bytes, int type, java.lang.Object orig, int from)
public static java.lang.Object malloc(int elems, long bytes, int type, java.lang.Object orig, int from, boolean force)
public static byte[] malloc1(int size)
public static byte[] malloc1(int size, boolean force)
public static short[] malloc2(int size)
public static int[] malloc4(int size)
public static long[] malloc8(int size)
public static float[] malloc4f(int size)
public static double[] malloc8d(int size)
public static boolean[] mallocZ(int size)
public static byte[] arrayCopyOfRange(byte[] orig, int from, int sz)
public static int[] arrayCopyOfRange(int[] orig, int from, int sz)
public static long[] arrayCopyOfRange(long[] orig, int from, int sz)
public static double[] arrayCopyOfRange(double[] orig, int from, int sz)
public static byte[] arrayCopyOf(byte[] orig, int sz)
public static int[] arrayCopyOf(int[] orig, int sz)
public static long[] arrayCopyOf(long[] orig, int sz)
public static double[] arrayCopyOf(double[] orig, int sz)
public static boolean tryReserveTaskMem(long m)
m
- - requested number of bytespublic static void reserveTaskMem(long m)
public static void freeTaskMem(long m)
m
-