I've been trying to parse a relatively large XML file with Klacks and
found what seems to be a memory leak inside Klacks parser.
1) When klacks sees the start of an element, an URI is pushed to the
'base-stack' field of 'context' structure ('klacks/element' calls
'p/sztag' which pushes the URI) but never actually removes it off the
stack.
2) Similarly, klacks pushes the namespace to the 'namespace-stack' field
of 'cxml-source' structure but never actually removes it off the stack
('klacks/element-2' pushes the namespace).
Attached is a proposed patch that seems to fix these issues.
With the patch, memory usage stays (almost) constant during parsing.