[xsd-users] in memory footprint

Boris Kolpackov boris at codesynthesis.com
Fri Oct 10 15:37:45 EDT 2008


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




More information about the xsd-users mailing list