nio2: NIO.2 file API companion code (streaming 5 GB at -Xmx64m, handle leaks, WatchService, mmap)
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KqJyCidz3ZgRyHABv2GVJh
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
$ java -Xmx64m ReadAllFail readAllLines medium.log
|
||||
OutOfMemoryError: Java heap space
|
||||
$ java -Xmx64m ReadAllFail readString medium.log
|
||||
OutOfMemoryError: Java heap space
|
||||
$ java -Xmx64m ReadAllFail readAllBytes medium.log
|
||||
OutOfMemoryError: Java heap space
|
||||
$ java -Xmx64m ReadAllFail readAllLines big.log
|
||||
OutOfMemoryError: Java heap space
|
||||
$ java -Xmx64m ReadAllFail readString big.log
|
||||
OutOfMemoryError: Required array size too large
|
||||
$ java -Xmx64m ReadAllFail readAllBytes big.log
|
||||
OutOfMemoryError: Required array size too large
|
||||
|
||||
How much heap does the 200 MB file need? (readAllLines, then readString)
|
||||
readAllLines -Xmx256m OutOfMemoryError: Java heap space
|
||||
readString -Xmx256m survived: 200000016 chars
|
||||
readAllLines -Xmx512m survived: 1378768 lines
|
||||
readString -Xmx512m survived: 200000016 chars
|
||||
readAllLines -Xmx1g survived: 1378768 lines
|
||||
readString -Xmx1g survived: 200000016 chars
|
||||
readAllLines -Xmx2g survived: 1378768 lines
|
||||
readString -Xmx2g survived: 200000016 chars
|
||||
Reference in New Issue
Block a user