Class PagePool


  • public class PagePool
    extends Object
    • Field Detail

      • idx

        protected final int idx
        Segment index.
      • pagesCntr

        protected final AtomicInteger pagesCntr
        Pool pages counter.
      • lastAllocatedIdxPtr

        protected long lastAllocatedIdxPtr
      • freePageListPtr

        protected long freePageListPtr
        Pointer to the address of the free page list.
      • pagesBase

        protected long pagesBase
        Pages base.
    • Method Detail

      • borrowOrAllocateFreePage

        public long borrowOrAllocateFreePage​(int tag)
                                      throws GridOffHeapOutOfMemoryException
        Allocates a new free page.
        Parameters:
        tag - Tag to initialize page RW lock.
        Returns:
        Relative pointer to the allocated page.
        Throws:
        GridOffHeapOutOfMemoryException - If failed to allocate new free page.
      • releaseFreePage

        public int releaseFreePage​(long relPtr)
        Parameters:
        relPtr - Relative pointer to free.
        Returns:
        Resulting number of pages in pool if pages counter is enabled, 0 otherwise.
      • pages

        public int pages()
        Returns:
        Max number of pages in the pool.
      • size

        public int size()
        Returns:
        Number of pages in the list.