Class MemoryLimitController


  • public class MemoryLimitController
    extends java.lang.Object
    Controller for tracking the amount of memory used for some task.
    • Constructor Detail

      • MemoryLimitController

        public MemoryLimitController​(long memoryLimitBytes)
    • Method Detail

      • tryReserveMemory

        public boolean tryReserveMemory​(long size)
      • reserveMemory

        public void reserveMemory​(long size)
                           throws java.lang.InterruptedException
        Throws:
        java.lang.InterruptedException
      • releaseMemory

        public void releaseMemory​(long size)
      • currentUsage

        public long currentUsage()