3 ms·
This isn't really a garbage collection problem. Any runtime using the same basic code would allocate system-crushing amounts of RAM, which is a problem on its o
by jerf 7y ago
This isn't really a garbage collection problem. Any runtime using the same basic code would allocate system-crushing amounts of RAM, which is a problem on its own regardless. This will cause other problems for other memory allocation techniques, such as this being a great recipe for fragmenting all of your RAM, and still having a fairly slow deallocation process due to sheer number of objects being churned.
The real problem here is that where a streaming parse is called for, a parser that fully manifests all the objects in RAM was used. Streaming parsers remain relatively rare.
(It's actually a legit advantage of the XML library infrastructure; they're readily available there, though typically you'll be using them directly because the libraries that build further layers of abstraction on parsing often concretely manifest everything in RAM anyhow....)