Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix MAXIMUM_PAGE_SIZE_BYTES comment + value
  • Loading branch information
JoshRosen committed Jul 29, 2015
commit 2c0eefc02951b769ffca4f7a4f0458d17c58b86c
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ private long getMemoryUsage() {
}
return sorter.getMemoryUsage() + totalPageSize;
}

@VisibleForTesting
public int getNumberOfAllocatedPages() {
return allocatedPages.size();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ public final class BytesToBytesMap {

private final double loadFactor;


/**
* The size of the data pages that hold key and value data. Map entries cannot span multiple
* pages, so this limits the maximum entry size.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,13 @@ public class TaskMemoryManager {
/** The number of entries in the page table. */
private static final int PAGE_TABLE_SIZE = 1 << PAGE_NUMBER_BITS;

/** Maximum supported data page size (in bytes). */
public static final long MAXIMUM_PAGE_SIZE_BYTES = (1L << OFFSET_BITS);
/**
* Maximum supported data page size (in bytes). In principle, the maximum addressable page size is
* (1L << OFFSET_BITS) bytes, which is 2+ petabytes. However, the on-heap allocator's maximum page
* size is limited by the maximum amount of data that can be stored in a long[] array, which is
* (2^32 - 1) * 8 bytes (or 16 gigabytes). Therefore, we cap this at 16 gigabytes.
*/
public static final long MAXIMUM_PAGE_SIZE_BYTES = (2^32 - 1) * 8L;

/** Bit mask for the lower 51 bits of a long. */
private static final long MASK_LONG_LOWER_51_BITS = 0x7FFFFFFFFFFFFL;
Expand Down