cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Urs Iwert" <>
Subject java.lang.OutOfMemoryError: Java heap space
Date Wed, 05 Oct 2005 09:04:39 GMT

In general the system works fine, but when I'm serving large (not huge)
files I run into an OutOfMemoryException. The pipeline loads some data
from a database. Language translation. Some further transformations
corrects or extends the xml structure. Transformation to xsl-fo.
Serialization to pdf. 

	<map:match pattern="reports/**/report.pdf">
		<map:generate type="serverpages"
		<map:transform type="i18n">
			<map:parameter name="locale"
		<map:transform src="stylesheets/general_fixes.xsl"/>
		<map:transform src="stylesheets/table_fixes.xsl"/>
		<map:transform src="stylesheets/doc2pdf.xsl"/>
			This stylesheet makes image URLs absolute, so
that FOP can display
			images. {realpath:/} returns the absolute path
of the context root. 
		<map:transform src="stylesheets/pdf_imagelinks.xsl"
			<map:parameter name="ctxroot"
			<map:parameter name="dir"
		<map:serialize type="fo2pdf"/>

I'm using similar pipelines for HTML, XLS and PS.

But when the result becomes larger the system runs into an exception:

- Servlet.service() for servlet Cocoon threw exception
java.lang.OutOfMemoryError: Java heap space

The problem occurs just before data is sent to the browser. In case of
html I can render more data. But I think it is because of the output in
HTML is less than the output for pdf. Limiting outputBufferSize it stops
at an amount of about 4.5MB. For PDF the message header is sent to the
browser. At least the PDF Reader starts. At the same moment the
exception occurs.

As it was mentioned earlier there are several possibilities to tune the
system. So I tried one after the other and all together, but not

I changed all my pipelines to noncaching

	<map:pipeline type="noncaching">
		<map:parameter name="outputBufferSize" value="4096"/>

I increased the heap size
	<parameter name="heapsize" value="512000000"/>

And changed the JAVA_OPTIONS

Environment Variable
	set JAVA_OPTIONS="-Xmx256m"

I also tried to change the initial memory pool, and maximum memory pool

Initial Memory Tomcat
	initial memory pool 128
	maximum memory pool 256

But nothing happened 

- Windows XP SP2  512MB
- Apache Tomcat / 5.5.7
- C:\Programme\Java\jre1.5.0_04\bin\client\jvm.dll
- Cocoon 2.1.7 full build

Urs Iwert

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message