Re: [xml] memory usage question

On Wed, Aug 17, 2005 at 08:59:21AM -0400, Rob Richards wrote:
Building a Tree I get vastly differing memory usage under windows 
compared to linux (same libxml2 code base). Both are using dictionairies.
Under windows:
MEMORY ALLOCATED : 85608844, MAX was 85618277

Under linux:
MEMORY ALLOCATED : 171403887, MAX was 171413249

Of course using the reader interface (not building tree) memory usage is 
similar in both cases:
MEMORY ALLOCATED : 171135, MAX was 172151

Question is why the drastic difference in memory usage when building a 
tree on the different platforms?

 Ho ho ... if it's really the same document on both side there is something
fishy, I can't think of anything leading to this, seems it's twice the size
on Linux, and I really can't see why. I would be very interested in feedback
on this, it may be a stupid accounting error in xmlmemory.c, or a real bug
which in that case sounds quite serious.

Also, any ideas on % of memory thats due to being a debug build?

 The memory reported is the sum of the size of the chunks requested by the
library at a given time. It does not take into account the extra data added
before and after every chunk for accounting and boundaries checking. So the
actual memory usage, depending on the system allocator performances for that
given request pattern is likely to be slightly larger. Running under memory
debug should not add other overhead than just this extra allocation size.


Daniel Veillard      | Red Hat Desktop team
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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