public class LazyMemorySegmentPool extends Object implements MemorySegmentPool, Closeable
MemorySegmentPool
that lazy allocate memory pages from MemoryManager
.Constructor and Description |
---|
LazyMemorySegmentPool(Object owner,
MemoryManager memoryManager,
int maxPages) |
Modifier and Type | Method and Description |
---|---|
List<MemorySegment> |
allocateSegments(int required) |
void |
cleanCache() |
void |
close() |
int |
freePages() |
MemorySegment |
nextSegment()
Gets the next memory segment.
|
int |
pageSize()
Get the page size of each page this pool holds.
|
void |
returnAll(List<MemorySegment> memory)
Return all pages back into this pool.
|
void |
returnPage(MemorySegment segment) |
public LazyMemorySegmentPool(Object owner, MemoryManager memoryManager, int maxPages)
public int pageSize()
MemorySegmentPool
pageSize
in interface MemorySegmentPool
public void returnAll(List<MemorySegment> memory)
MemorySegmentPool
returnAll
in interface MemorySegmentPool
memory
- the pages which want to be returned.public void returnPage(MemorySegment segment)
public MemorySegment nextSegment()
MemorySegmentSource
nextSegment
in interface MemorySegmentSource
public List<MemorySegment> allocateSegments(int required)
public int freePages()
freePages
in interface MemorySegmentPool
public void close()
close
in interface Closeable
close
in interface AutoCloseable
public void cleanCache()
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.