Xerces consuming memory when reusing parser 2003-03-13 - By sandygao@(protected)
Does seem like a bug. Where the objects are allocated would be extremely useful. Could you also provide your xml/xsd files. Thx.
Sandy Gao Software Developer, IBM Canada (1-905) 413-3255 sandygao@(protected)
Rob Griffin <rob.griffin@(protected) To: xerces-j-user@(protected) .apache.org uest.com> cc: Subject: Xerces consuming memory when reusing parser 03/11/2003 08:31 PM Please respond to xerces-j-user
Hi,
I have a problem with Xerces 2.3.0 consuming memory in a long running application.
Here's my setup code:
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance (); factory.setValidating(true); factory.setIgnoringComments(true); factory.setNamespaceAware(true); factory.setAttribute(" http://apache.org/xml/features/dom/defer-node-expansion", Boolean.FALSE); factory.setAttribute(" http://xml.org/sax/features/external-parameter-entities", Boolean.FALSE); factory.setAttribute(" http://apache.org/xml/features/validation/schema", Boolean.TRUE);
I am using an XML Schema for validation.
I then get one instance of DocumentBuilder from this factory and use it to repeatedly validate documents.
Last night I ran it overnight with another process feeding in a small XML document ( < 10 elements) every ten seconds. This morning I see more than 260,000 instances of org.apache.xerces.impl.xs.XSAttributeUseImpl. Forcing a garbage collection does not free these objects. There are no other objects with anywhere near this count.
The resulting document is being used to create a Java object, but in this case that object is almost immediately deferenced. I can see the count of that type fall to zero periodically, which is what I expect.
Is this a bug? If so I can give more details about where these objects are being allocated.
As a workaround I am now periodically creating a new DocumentBuilderFactory and DocumentBuilder and this fixes the problem, but I'd rather not have to do this.
Regards,
Rob Griffin Software Engineer Quest Software 2/293 Camberwell Road Camberwell, Victoria 3124 Australia Phone: +613 98118021 Fax: +613 9811 8099 http://www.quest.com
--------------------------------------------------------------------- To unsubscribe, e-mail: xerces-j-user-unsubscribe@(protected) For additional commands, e-mail: xerces-j-user-help@(protected)
|
|