Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ERROR: 'Java heap space', how to fix it

807605Jul 11 2007 — edited Jul 11 2007
hi,

i am getting the heap space error for my application. please tell me how can i increase the heap size.
i am using tomcat 5 and eclipseMe 5.1

actully i m trying to transform xhtml to wml using xsl file with the transform API.

here is the line of code which is doing this.

........................................................

public void transformer(String xsltFilePath) {

Result xmlResult = null;
String result = new String();
try{
logger.info("Starting transcoding process");

//read the xslt file
File xsltFile = new File(xsltFilePath);

String str2 = xsltFile.getName();

logger.info("XSLT file name: " + str2);

//construct a stream source from the xml file or URL
Source xmlSource = new StreamSource(xhtmlURL);

//Construct a stream source from the xslt file
Source xsltSource = new StreamSource(xsltFile);

TransformerFactory xsltfactory = TransformerFactory.newInstance();
Transformer xsltengine = xsltfactory.newTransformer(xsltSource);



xmlResult = new StreamResult(new FileOutputStream("C:/temp/outFilename"));


try{
// on this line of code , i get the heap size error.
xsltengine.transform(xmlSource, xmlResult);


}catch (Exception e) {

System.out.println("IN TRANSER HEAP prblem");
e.printStackTrace();
}



logger.info("XML TO WML TRANSFORMATION IS COMPLETED.");
}catch(Exception e)
{
logger.info("ppppppppp222222222pppppppppppppo");
e.printStackTrace();
}

}

..................................

pleas guide me what can i do to get rid of this problem and tell me how can i increase the heap size.

Kind Regards,
Qasitocuh.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 8 2007
Added on Jul 11 2007
6 comments
1,165 views