code: private void acquireNewPageIfNecessary(int required) {
      if (currentPage == null ||
        pageCursor + required > currentPage.getBaseOffset() + currentPage.size()) {
        // TODO: try to find space on previous pages
        currentPage = allocatePage(required);
        pageCursor = currentPage.getBaseOffset();
        allocatedPages.add(currentPage);
      }
    }
docs: Allocates more memory in order to insert an additional record. This will request additional
  memory from the memory manager and spill if the requested memory can not be obtained.
  
  @param required the required space in the data page, in bytes, including space for storing
  the record size. This must be less than or equal to the page size (records
  that exceed the page size are handled via a different code path which uses
  special overflow pages).