[xsd-users] in memory footprint

Rizzuto, Raymond Raymond.Rizzuto at sig.com
Thu Oct 9 18:27:16 EDT 2008


I'm hitting an out of memory issue with my application.  The app creates an instance of an XML type SimpleOrder that represents a stock order.  It keeps it around so that it can update and output it as XML to a consuming system whenever the stock order is updated.  It turns out that many orders are long-lived, so once I get about 2000 orders, I start getting bad_malloc exceptions, and it is all downhill from that point.

The app runs under Linux, 32 bit.  It grows in virtual image size, as reported by top, from an initial 100meg to ~3gig.   If I comment out the logic that creates/updates the SimpleOrder, there is no memory growth, so it seems very likely that the issue is the size of the in memory object.  This works out to about 1.5meg per SimpleOrder, which seems excessive since it is under 3K serialized out as XML.

Is there any way to reduce the memory footprint?  Baring that, I may want to save the SimpleOrder out to a file or db when not in use.  I.e. serialize/deserialize it via XML, or possible Boost's serialization library.  However,  I am concerned about the performance hit of that approach.

Ray


IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.




More information about the xsd-users mailing list