bufferedreader: read a file line by line module (BufferedReader vs Scanner vs Files.lines vs readAllLines on a 1 GB file; heap at -Xmx64m, timings, read-call counts, one-huge-line OOM, charset/BOM/line-terminator pitfalls, Scanner swallowing IOException), 10 contract tests
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b3pDoGLiWk6LLBeHjW
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
$ java -Xmx128m LongLineDemo line long.txt
|
||||
mode=line -Xmx128 MB
|
||||
OutOfMemoryError: Java heap space
|
||||
$ java -Xmx128m LongLineDemo chunks long.txt
|
||||
mode=chunks -Xmx128 MB
|
||||
read(char[]) processed 200,000,071 chars, 2,739,727 commas, never holding more than 8192 chars
|
||||
Reference in New Issue
Block a user