[xsd-users] in memory footprint

Rizzuto, Raymond Raymond.Rizzuto at sig.com
Fri Oct 10 15:53:01 EDT 2008


Boris,

Well, that jibes with what I saw when I took the same test code, including the mem_allocate code you sent me, and built under Window.  I was using xerces 3.0.0 there, and didn't see any 65536 byte allocations.

For now, I can live without the --generate-wildcard option since I'm only generating XML, and consuming what I generate (in debug mode only).  I'm going to look into moving to the 3.0.0 version of xerces as part of moving off sles9 and gcc 3.3.3.  It's a very old environment, and has other issues as well.

Ray

-----Original Message-----
From: Boris Kolpackov [mailto:boris at codesynthesis.com]
Sent: Friday, October 10, 2008 3:38 PM
To: Rizzuto, Raymond
Cc: xsd-users at codesynthesis.com
Subject: Re: [xsd-users] in memory footprint

Hi Ray,

Rizzuto, Raymond <Raymond.Rizzuto at sig.com> writes:

> 1) removed --generate-wildcard

Ok, this explains it. Your schema has a wildcard and when this
option is present the wildcard content is stored as a DOM fragment.
To have a DOM fragment in Xerces-C++ one needs a DOM document. To
support this each type that has one or more wildcards also contains
a DOM document in which wildcard content is stored. This document
is around even if there is no wildcard content set in the object.

I modified my test to include an optional xsd:any in each book
objects. That means that there will be total 16 DOM documents
per library object. Here is what I get with various versions
of Xerces-C++:

2.7.0:

allocate:
  count: 365
  bytes: 1064116

free:
  count: 84
  bytes: 1180


2.8.0:

allocate:
  count: 349
  bytes: 277588

free:
  count: 68
  bytes: 1020


3.0.0:

allocate:
  count: 326
  bytes: 32000

free:
  count: 68
  bytes: 1020

As you can see empty DOM documents in Xerces-C++ 2.7.0 are quite
expensive. Things got a bit better in 2.8.0 once exponential growth
of the DOM heap was implemented. Xerces-C++ 3.0.0 reduced the empty
document overhead significantly. Furthermore, Xerces-C++ 3.0.0 allows
you to tune global DOM heap allocation parameters (e.g., initial
allocation size) as well as on the per-document basis.

Boris

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