PLEASE DO NOT REPLY TO THIS MESSAGE. TO FURTHER COMMENT ON THE STATUS OF THIS BUG PLEASE FOLLOW THE LINK BELOW AND USE THE ON-LINE APPLICATION. REPLYING TO THIS MESSAGE DOES NOT UPDATE THE DATABASE, AND SO YOUR COMMENT WILL BE LOST SOMEWHERE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3472 *** shadow/3472 Thu Sep 6 13:08:05 2001 --- shadow/3472.tmp.23752 Thu Sep 6 13:08:05 2001 *************** *** 0 **** --- 1,83 ---- + +============================================================================+ + | java.lang.OutOfMemoryError while transforming XmlDocument | + +----------------------------------------------------------------------------+ + | Bug #: 3472 Product: XalanJ2 | + | Status: NEW Version: 2.0.0 | + | Resolution: Platform: Sun | + | Severity: Critical OS/Version: Other | + | Priority: Other Component: org.apache.xalan.transf | + +----------------------------------------------------------------------------+ + | Assigned To: [EMAIL PROTECTED] | + | Reported By: [EMAIL PROTECTED] | + | CC list: Cc: | + +----------------------------------------------------------------------------+ + | URL: | + +============================================================================+ + | DESCRIPTION | + We are using Servlet running on a Solaris box with Netscape Enterprise Server + 4.0 SP4, which uses Xalan-J_2_0_0 for transforming XmlDocuments [Using + javax.xml.transform.Templates class]. The Max Heap Size for the JVM [version + 1.2.2] [used by the webserver] is 528 MB. The code used for transforming is .... + + private InputSource transformSource ( StreamSource inSource, Transformer + ransformer ) { + InputSource source = null; + StreamResult result = null; + StringWriter writer = null; + StringReader reader = null; + StringBuffer buffer = null; + try { + writer = new StringWriter ( ); + result = new StreamResult( writer ); + transformer.transform( inSource,result ); + buffer = writer.getBuffer( ); + reader = new StringReader( buffer.toString( )); + source = new InputSource( reader ); + } catch (Exception exp ) { + exp.printStackTrace( ); + } finally { + try { + writer.flush( ); + writer.close( ); + writer = null; + buffer = null; + } catch (Exception exp ) { + exp.printStackTrace( ); + } + } + return source; + + } + + + We are getting a "java.lang.OutOfMemoryError" while transforming XMLDocument + using the above code . This Exception occurs after the application has run for + a period of 1 to 2 days. + The Exception trace is .... + Internal error: exception thrown from the servlet service function + (uri=/ESP/servlet/ESPServlet): java.lang.OutOfMemoryError, Stack: + java.lang.OutOfMemoryError + at org.apache.xerces.readers.CharReader.fillCurrentChunk + (CharReader.java, Compiled Code) + at org.apache.xerces.readers.CharReader.(CharReader.java, Compiled + Code) + at org.apache.xerces.readers.DefaultReaderFactory.createCharReader + (DefaultReaderFactory.java, Compiled Code) + at org.apache.xerces.readers.DefaultReaderFactory.createReader + (DefaultReaderFactory.java, Compiled Code) + at + org.apache.xerces.readers.DefaultEntityHandler.startReadingFromDocument + (DefaultEntityHandler.java, Compiled Code) + at org.apache.xerces.framework.XMLParser.parseSomeSetup(XMLParser.java, + Compiled Code) + at org.apache.xerces.framework.XMLParser.parse(XMLParser.java, Compiled + Code) + at org.apache.xalan.transformer.TransformerImpl.transform + (TransformerImpl.java, Compiled Code) + at org.apache.xalan.transformer.TransformerImpl.transform + (TransformerImpl.java, Compiled Code) + + Can anybody suggest what else can be done to clean up the memory? + Any help is greatly appreciated. + - + seetha.
