[xsd-users] out of memory problem

Boris Kolpackov boris at codesynthesis.com
Fri Oct 22 15:54:50 EDT 2010


Hi Bill,

Wheeler, Bill NPO <bill.npo.wheeler at intel.com> writes:

> I'm using your tree parsing software (version 3.3 /w xerces 3.1.1) to 
> process 1000's of XML files.  Well into the processing, the 
> OutOfMemoryException in MemoryManagerImpl::allocate is thrown.
> The strange thing about this is that I am nowhere near my memory
> quota when this happens (I'm less than 1/10 th of my limit).  
> After each parse op, I am always cleaning up the tree by calling 
> "reset()" on the std::auto_ptr<> object holding the root of the 
> parsed tree.

Do you call one of the generated parsing functions or do you setup
the Xerces-C++ parser yourself?

If you call the parsing function (and assuming there are no memory
leaks), then the only thing that I can think of is the heap 
fragmentation. That is, the heap gets so fragmented that the heap
implementation has to keep allocating more and more process memory
with each parse operation. In this case it would be helpful to know
which platform you are running this on.

Also, can you try to reproduce this problem using the 'performance'
example? You can create a test file as big as your real XML documents
using the supplied gen.cxx program. You can also comment out the call
to serialization() to only test parsing.

Boris



More information about the xsd-users mailing list