Re: [xml] Memory not going away..



On Tue, Mar 08, 2005 at 05:52:09PM -0500, David W. Bauer Jr. wrote:
One thing that I should mention is that the memory is NOT being released.
I know this for a fact becuase my application goes on (afer freeing the
xmlDoc) and allocates until the 3GB limit is reached.

So, what I see is this:

      read / parse the file

              --> memory consumed goes to 2.9GB

      free the xmlDoc

              --> memory consumption reported is still the same

      alloc .1 GB more data structures, then malloc fails due to
      process memory limit.

So, the xmlDoc is NOT being freed in any way.

  My experience:
    dba100000.xml in the XML directory is 20 MBytes
    parsed as a DOM tree it uses 100MB of memory
    xmllint --repeat --noout dba100000.xml
    stay at 105MB memory usage in top looping 
      parsing/freeing
    my desktop has 512MB and didn't even swap during the experiment.
    System is libxml2 from CVS on an RHEL4 AS system.

I cannot reproduce your problem, or your problem is with the memory allocator
of the linux system you used.

The purpose of the test case was to determine if the system would report
the memory being freed with _fewer_ calls to the memory library, which is
a valid approach since it isolates only the problem being addressed.  If I
were to read/free the doc, then attempt to allocate more memory, it fails
since the doc is still in memory.

  The document is being freed. libxml2 call free() unless somewhere
somthing changed the behaviour of xmlFree() in your program.

One major difference is that I am now getting info in the .memdump file,
which I did not get in my test script:

[...]
      MEMORY ALLOCATED : 32092, MAX was 212704970

  libxml2 gave back the 2.1 GB of memory to the libc, it just has 
32 KBytes left.

Daniel

-- 
Daniel Veillard      | Red Hat Desktop team http://redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



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