4 ms·
Googles "parse csv Java" Copies and pasted top answer that buffers the whole thing into the heap before parsing Blames Java/hardware when this doesn't scale
by VRay 7y ago
Googles "parse csv Java"
Copies and pasted top answer that buffers the whole thing into the heap before parsing
Blames Java/hardware when this doesn't scale
- AtlasBarfed 7y agoBad string allocations can easily swamp the JVM, with things like loops adding a single character to a string with a string allocation each loop, and other naive approaches turning what should be a small reused buffer into gigabytes of heap. The JVM does a remarkable job of just-good-enough don't-worry-about-GC, but anyone who is a paid programmer needs to understand rudimentary aspects of GC, or your stuff will go sideways fast in production.
- nottorp 7y ago<quote>Bad string allocations can easily swamp the JVM</quote> Like String.split() and whatever BufferedReader does, I guess. It's not like i was doing byte by byte manipulation. The GC just triggered too often.