Thursday, January 20, 2011

OSB parsing a file into XML with FileAdapter: memory consumption


this is the behaviour of memory every time we parse a 5MB file into XML.
Basically 5MB of info generates a 500 MB spike in the heap memory - luckily garbage collected quite soon.

A 10000% increase in memory occupation in not such a great idea.

The believers that XML is the next best thing after sex should probably change their mind. And not in the sense that XML is better than sex.

1 comment:

Digital said...

I think you might be interested in how jvm works and how it decides when and how many memory should it obtain.
I mean its not necessarily osb needed 500 whole mb to parse that file into xml.
More on topic here:
http://www.oracle.com/technetwork/java/javase/gc-tuning-6-140523.html