$ java -Xmx64m MappedDemo big.log file big.log: 5,000,000,069 bytes, -Xmx=64 MiB, RSS at start=40 MiB classic map of the whole file: IllegalArgumentException: Size exceeds Integer.MAX_VALUE Arena + MemorySegment: 34,120,522 newlines in 5.1 s; RSS after the Arena was closed=51 MiB classic 1 GiB windows: 34,120,522 newlines in 7.8 s; RSS right after=4821 MiB heap: -Xmx=64 MiB, peak used (sampled every 20 ms)=4 MiB, GC collections=0, GC time=0 ms RSS one second after System.gc()=52 MiB