Class MemoryPoolAssigner


  • @ThreadSafe
    public final class MemoryPoolAssigner
    extends java.lang.Object
    The MemoryPoolAssigner assigns the memory that Nemo uses for writing data blocks from the MemoryPoolAssigner.MemoryPool. Memory is represented in chunks of equal size. Consumers of off-heap memory acquire the memory by requesting a number of MemoryChunk they need. MemoryPoolAssigner currently supports allocation of off-heap memory only. MemoryChunks are allocated on-demand, but if the total allocated memory exceeds the maxOffheapMb, MemoryAllocationException is thrown and the job fails. TODO #397: Separation of JVM heap region and off-heap memory region
    • Constructor Summary

      Constructors 
      Constructor Description
      MemoryPoolAssigner​(int memory, double maxOffheapRatio, int chunkSizeKb)  
    • Constructor Detail

      • MemoryPoolAssigner

        @Inject
        public MemoryPoolAssigner​(int memory,
                                  double maxOffheapRatio,
                                  int chunkSizeKb)
    • Method Detail

      • returnChunksToPool

        public void returnChunksToPool​(java.lang.Iterable<MemoryChunk> target)
        Returns all the MemoryChunks in the given List of MemoryChunks.
        Parameters:
        target - the list of MemoryChunks to be returned to the memory pool.
      • getChunkSize

        public int getChunkSize()
        Returns the chunk size of the memory pool.
        Returns:
        the chunk size in bytes.