Re: [xml] Memory usage 32 bit vs. 64 bit Linux

On Tue, May 12, 2015 at 10:28:34AM +0200, Robert Grasböck wrote:
Hello Stefan!

Memory consumption has nearly decreased by 50%, that's the good thing.
But the bad thing is that the documentation says:

"no modification of the tree allowed afterwards (will possibly crash if you
try to modify the tree)"

Should I be worry about it?

  The Compact option stores the small text string in the unused pointers
when possible, but it makes changes to the tree content way harder.
As long as you generate the tree to scan it and not change it that's safe
if you dynamically change the tree from your application, there is risks


best regards

2015-05-11 21:32 GMT+02:00 Stefan Behnel <stefan_ml behnel de>:

Robert Grasböck schrieb am 05.05.2015 um 15:52:
I have a question about memory usage of libxml2.
I'm using libxml2 on two different systems, once a 32 bit linux other
one a
64 bit linux.
On both I run the same application which use libxml2 to parse xml files.
The application opens many small xml files (~200) with xmlParseFile.
The document (xmlDocPtr) stays open in memory.
I now noticed that the application running on 64 bit Linux uses more the
times the heap memory as on the 32 bit version. I could understand a
up of used memory due to all the pointers are now double the size. But 4

I did a check with valgrinds massif tool and it tells me that most of the
heap allocation (in my case 2/3 of the total heap consumption) comes from
libxml2 xmlParseFile.

I don't know if it's a issue of libxml2 directly, but it seems it is.
I would appreciate any suggestions to get the memory usage down!

Have you enabled the COMPACT parsing option? It avoids text nodes for short
text content and benefits a lot from a 64 bit architecture.


xml mailing list, project page
xml gnome org

xml mailing list, project page
xml gnome org

Daniel Veillard      | Open Source and Standards, Red Hat
veillard redhat com  | libxml Gnome XML XSLT toolkit | virtualization library

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]