Link to home
Start Free TrialLog in
Avatar of alcani
alcani

asked on

XSL FO

Hi,
I normally work with xsl-fo for transform xml files into pdf.
Usually I do it with small xml files.
Now I want to do it using a large XML file (5000 records)
I got the following error message
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

I read on apache’s site that:
To avoid errors like this, you need to pass an extra parameter to the java
command used in the fop script. This can be accomplished by creating a
~/.foprc (which is sourced by the fop script) and adding the parameter to the
FOP_OPTS environment variable.

The fop script looks for a FOP_HOME environment variable to locate the FOP
class libraries. You can create this variable using the ~/.foprc file as well.
Create a ~/.foprc file using the following commands:

cat > ~/.foprc << "EOF"
FOP_OPTS="-Xmx<RAM_Installed>m"
FOP_HOME="/opt/fop"

EOF

Replace <RAM_Installed> with a number representing the amount of RAM installed
in your computer (in megabytes). An example would be FOP_OPTS="-Xmx768m". For
more information about memory issues running FOP, see
http://xml.apache.org/fop/running.html#memory.

To include the fop  script in your path, update your personal or system-wide
profile with the following:
PATH=$PATH:/opt/fop
-----------------

However it takes very long time to process the information (about 2 hrs)
There is another way to solve this issue?
Any other recommendation, for example using another similar tool?

Thank you for your comments,
ASKER CERTIFIED SOLUTION
Avatar of Gertone (Geert Bormans)
Gertone (Geert Bormans)
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.