[xml] Memory not going away..



I have a simple test script I am using to my code:

int
main(int argc, char **argv, char **env)
{
        xmlDocPtr       document_network = NULL;
        xmlXPathContextPtr ctxt = NULL;

        xmlXPathInit();
        xmlSetDocCompressMode(document_network, 9);
        document_network = xmlParseFile("network.xml");
        ctxt = xmlXPathNewContext(document_network);

        xmlXPathFreeContext(ctxt);
        xmlFreeDoc(document_network);
        xmlCleanupParser();
        xmlMemoryDump();

        return 0;
}

If I run this in gdb and break on the return statement, then view the
memory usage in top, ps or /proc, I notice that the memory usage does not
go away.

I am using a 300GB file, and the parser is requiring about 3GB if
RAM.  Sorry if this is a simple oversight on my part, but I could not find
the solution in the code examples or online archive.

Thanks in advance for any help!

David Bauer

Ph.D Candidate, Rensselaer Polytechnic Institute
Computer Science Department

Office: Amos Eaton 205
Phone : (518) 276 2657
URI   : http://www.cs.rpi.edu/~bauerd



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