Class ODirectMemoryAllocator
java.lang.Object
com.orientechnologies.common.directmemory.ODirectMemoryAllocator
- All Implemented Interfaces:
ODirectMemoryAllocatorMXBean
Manages all allocations/deallocations from/to direct memory. Also tracks the presence of memory
leaks.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAllocates chunk of direct memory of given size.voidVerifies that all pointers which were allocated by allocator are freed.voidChecks reference queue to find direct memory leaksvoiddeallocate(OPointer pointer) Returns allocated direct memory back to OSlongstatic intstatic ODirectMemoryAllocatorinstance()
-
Constructor Details
-
ODirectMemoryAllocator
public ODirectMemoryAllocator()
-
-
Method Details
-
instance
- Returns:
- singleton instance.
-
allocate
Allocates chunk of direct memory of given size.- Parameters:
size- Amount of memory to allocateclear- clears memory if neededintention- Why this memory is allocated. This parameter is used for memory profiling.- Returns:
- Pointer to allocated memory
- Throws:
ODirectMemoryAllocationFailedException- if it is impossible to allocate amount of direct memory of given size
-
deallocate
Returns allocated direct memory back to OS -
getMemoryConsumption
public long getMemoryConsumption()- Specified by:
getMemoryConsumptionin interfaceODirectMemoryAllocatorMXBean- Returns:
- Amount of direct memory allocated using this allocator
-
checkMemoryLeaks
public void checkMemoryLeaks()Verifies that all pointers which were allocated by allocator are freed. -
checkTrackedPointerLeaks
public void checkTrackedPointerLeaks()Checks reference queue to find direct memory leaks -
id
-