Class MallocMT
java.lang.Object
one.nio.mem.Malloc
one.nio.mem.MallocMT
- All Implemented Interfaces:
Allocator, MallocMXBean
- Direct Known Subclasses:
MallocAnalyzer
-
Field Summary
FieldsFields inherited from class Malloc
base, BASE_OFFSET, BIN_COUNT, BIN_SIZE, BIN_SPACE, capacity, CAPACITY_OFFSET, FREE_MASK, HEADER_SIZE, LEFT_OFFSET, MAX_CHUNK, MIN_CHUNK, NEXT_OFFSET, OCCUPIED_MASK, PREV_OFFSET, SIGNATURE_OFFSET, SIGNATURE_V2, SIGNATURE_V3, SIZE_OFFSET -
Constructor Summary
ConstructorsConstructorDescriptionMallocMT(long capacity) MallocMT(long capacity, int concurrencyLevel) MallocMT(long base, long capacity) MallocMT(long base, long capacity, int concurrencyLevel) MallocMT(MappedFile mmap) MallocMT(MappedFile mmap, int concurrencyLevel) -
Method Summary
Modifier and TypeMethodDescriptionintallocatedSize(long address) voidfree(long address) long(package private) voidinit()private voidinitSegments(int concurrencyLevel) longmalloc(int size) segment(int index) private MallocsegmentByAddress(long address) segmentFor(long n) Deterministically get one of the segments by somelongvalueintsegments()voidverify()Verify the layout of the heap.Methods inherited from class Malloc
base, binSize, calloc, chooseBin, getBin, getTotalMemory, getUsedMemory, mallocImpl
-
Field Details
-
DEFAULT_CONCURRENCY_LEVEL
public static final int DEFAULT_CONCURRENCY_LEVEL- See Also:
-
segments
-
segmentSize
private long segmentSize
-
-
Constructor Details
-
MallocMT
public MallocMT(long capacity, int concurrencyLevel) -
MallocMT
public MallocMT(long capacity) -
MallocMT
public MallocMT(long base, long capacity, int concurrencyLevel) -
MallocMT
public MallocMT(long base, long capacity) -
MallocMT
-
MallocMT
-
-
Method Details
-
segments
public int segments() -
segment
-
segmentFor
-
getFreeMemory
public long getFreeMemory()- Specified by:
getFreeMemoryin interfaceMallocMXBean- Overrides:
getFreeMemoryin classMalloc
-
malloc
-
segmentByAddress
-
free
-
allocatedSize
public int allocatedSize(long address) - Overrides:
allocatedSizein classMalloc
-
verify
-
init
-
initSegments
private void initSegments(int concurrencyLevel)
-