You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Philip Stander <ph...@globetom.co.za> on 2005/01/01 08:58:03 UTC

Xerces memory allocation management

Hi,

We are using Xerces C++ very successfully in a real-time transaction switching application. Performance is excellent, but one drawback seems to be memory fragmentation behaviour resulting in continuous arena growth that seems to be caused by the document-based memory management implementation. 

I was wondering if you would consider incorporation of changes to move memory management up to the parser so that the parser dishes out memory blocks for document parses - as an option during compilation. For constructed documents you would then also have to supply a parser to be used to dish out memory. 

The parser will then keep a high water mark and the allocated memory area gets reset in the ResetDocumentPool method. 

We have implemented these changes in Xerces 1.6 and will now redo on Xerces 2.x. These changes worked well, but some better design may prove beneficial as it does not fit to pass a parser object to a document being construcuted. Perhaps a separate memory manager class is required with methods that allows setting of allocation chunk sizes etc. - this can then be supplied to documents being constructed and to Prser objects for use during document parsing.

I may also be missing something altogether?

An algorithm like this will relieve significant strain on applications parsing documents at a very high rate and that typically processes a lot of the same type & size documents as is the case in our transactional system.

Your feedback would be much appreciated.

Regards
Philip Stander
philip.stander@globetom.co.za