private static int guessPendingChunkLimit(long chunkSize) {
    int minChunks = 1;
    int maxChunks = (int) (MAX_BYTES_TO_USE / chunkSize);
    int targetChunks = (int) (ProcessInfo.getMaxMemoryBytes() * 0.5d / chunkSize);
    return Math.clamp(targetChunks, minChunks, maxChunks);
  }
A map from sequential {@code long} keys to {@code long} values backed by a file on disk where the key defines the
offset in the input file.
<p>
During write phase, values are stored in a sliding window of {@link ByteBuffer ByteBuffers} and flushed to disk when
the segment slides out of the window. During read phase, they file is memory-mapped and read.
planetiler-core/src/main/java/com/onthegomap/planetiler/collection/ArrayLongLongMapMmap.java