code: protected MemoryBlock allocatePage(long required) {
      MemoryBlock page = taskMemoryManager.allocatePage(Math.max(pageSize, required), this);
      if (page == null || page.size() < required) {
        throwOom(page, required);
      }
      used += page.size();
      return page;
    }
docs: Allocate a memory block with at least `required` bytes.
  
  @throws SparkOutOfMemoryError