Package org.deepjava.runtime.arm32
Class Heap
- java.lang.Object
-
- org.deepjava.runtime.arm32.Heap
-
- All Implemented Interfaces:
IdeepCompilerConstants
public class Heap extends Object implements IdeepCompilerConstants
Heap manager with mark-sweep garbage collection.
As soon as the remaining heap space is lower than a third of the total available heap space, a garbage collection is called.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static boolean
runGC
static int
sysTabBaseAddr
Base address of the system table.-
Fields inherited from interface org.deepjava.runtime.IdeepCompilerConstants
cblkClinitAddrOffset, cblkCodeBaseOffset, cblkCodeSizeOffset, cblkConstBlockSizeOffset, cblkNofPtrsOffset, cblkPtrAddr0Offset, cblkVarBaseOffset, cblkVarSizeOffset, stClassConstOffset, stHeapOffset, stKernelClinitAddr, stNofStacks, stResetOffset, stSizeToCopy, stStackOffset
-
-
Constructor Summary
Constructors Constructor Description Heap()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int[]
getFreeBlocks()
Used for debugging purposes.static int
getFreeHeap()
Query free heap size.static int
getHeapBase()
Query base address of heap.static int
getHeapSize()
Query total heap size.static int[]
getNofFreeBlocks()
Used for debugging purposes.static int
getNofMarkedObjs()
Used for debugging purposes.static int
getNofMarkedPrimArrays()
Used for debugging purposes.static int
getNofMarkedRefArrays()
Used for debugging purposes.static int
getNofMarkedRegObjs()
Used for debugging purposes.static int
getNofRoots()
Used for debugging purposes.static int[]
getRoots()
Used for debugging purposes.static void
mark()
Starts mark phase of garbage collection.static void
sweep()
Starts sweep phase of garbage collection.
-
-
-
Method Detail
-
mark
public static void mark()
Starts mark phase of garbage collection. This method should be solely used for test purposes. Never use it in application code! A garbage collection is automatically done when available heap space is low.
-
sweep
public static void sweep()
Starts sweep phase of garbage collection. This method should be solely used for test purposes. Never use it in application code! A garbage collection is automatically done when available heap space is low.
-
getHeapSize
public static int getHeapSize()
Query total heap size.- Returns:
- Total heap size in bytes.
-
getHeapBase
public static int getHeapBase()
Query base address of heap.- Returns:
- Base address of heap.
-
getFreeHeap
public static int getFreeHeap()
Query free heap size.- Returns:
- Free heap size in bytes.
-
getNofRoots
public static int getNofRoots()
Used for debugging purposes.- Returns:
- Number of roots.
-
getRoots
public static int[] getRoots()
Used for debugging purposes.- Returns:
- Array of roots.
-
getFreeBlocks
public static int[] getFreeBlocks()
Used for debugging purposes.- Returns:
- Array of free blocks.
-
getNofFreeBlocks
public static int[] getNofFreeBlocks()
Used for debugging purposes.- Returns:
- Array of number of free blocks.
-
getNofMarkedObjs
public static int getNofMarkedObjs()
Used for debugging purposes.- Returns:
- Number of marked objects.
-
getNofMarkedRefArrays
public static int getNofMarkedRefArrays()
Used for debugging purposes.- Returns:
- Array of number of marked reference arrays.
-
getNofMarkedPrimArrays
public static int getNofMarkedPrimArrays()
Used for debugging purposes.- Returns:
- Array of number of marked primitives arrays.
-
getNofMarkedRegObjs
public static int getNofMarkedRegObjs()
Used for debugging purposes.- Returns:
- Array of number of marked regular objects arrays.
-
-