Logout Developer Knowledgebase Search Adobe Partners Main Adobe Solution Partner Finder Adobe Solution Partner Program Support Developer Knowledgebase Adobe Solution Partner Program Products & Technology Adobe
Developer Knowledgebase

Knowledgebase HomeGraphics Server KB

Overview
Software Development Kits
Developer Knowledgebase
Support
Legal Notices
Feedback
Adobe Solution Partner Program
Join
Find a Solution Partner

Product
Graphics Server
 
Version
2.1
 
Last Edited
25-Aug-2006
 
Document
52634

How To: Allocating more memory for Java and Tomcat

Summary
To avoid java.lang.OutOfMemory errors, increase the value of -Xmx512M


Issue
I 'm getting java.lang.OutOfMemory errors

Applies to
Adobe Graphics Server
Adobe Document Server

Solution
The problem is that by default, the Java Virtual Machine and Tomcat (WebServices) only use a small amount of memory.  You can adjust the RAM they will use with the -Xmx option as in -Xmx1000M. (Meaning use up to 1000MB if available.)

When using the WebServices from the Java command line, you must use the -Xmx option twice. Once to increase the RAM available to Tomcat (WebServices), and second for the Java command line.


Determining how much RAM is needed
If you're working with images that are roughly 4000 x 4000 pixels and one layer, try -Xmx1000M as a starting point.
  • Run your commands against your largest file and watch the memory usage of the Java processes.
    On Windows: use the "Processes" tab of the "Windows Task Manager"
    On Solaris: run "prstat" in a Console window
  • Adjust the value of -Xmx based on the RAM requirements of your commands and your files. (convertProfile and saveOptimized use more RAM than some of the other commands.)


Assign more RAM to the Java command line examples
1. Open, for example, ResizeImage.bat or ResizeImage.sh at:
     {your install location}\Samples\java\commandline\ResizeImage.bat

2. Add -Xmx1000M to the line:
     set COMMAND=java -cp "%THECLASSPATH%" com.adobe.altercast.commandline.ResizeImage %*
resulting in:
     set COMMAND=java -Xmx1000M -cp "%THECLASSPATH%" com.adobe.altercast.commandline.ResizeImage %*


Assign more RAM to Tomcat (WebServices) on Windows
  1. Open wrapper.properties at:
    {your install location}\server\conf\wrapper.properties
  2. Scroll down to the bottom and you will find:
    # This is the command line that is used to start Tomcat. You can *add* extra
    # parameters to it but you can not remove anything.
    # wrapper.cmd_line="$(wrapper.javabin)" -Xrs
    -Xmx512M -classpath "$(wrapper.class_path)" $(wrapper.startup_class) -config "$(wrapper.server_xml)" -home "$(AlterCastTomcatHome)"
  3. Modify the value of: -Xmx512M
  4. Restart the AlterCastDocEdition service or the AlterCastImageEdition service in the Services control panel.

Assign more RAM to Tomcat (WebServices) on Solaris
  1. Open in a text editor tomcat.sh at {your install location}/server/bin/tomcat.sh
  2. Find the line reading:  TOMCAT_OPTS=" -Xmx512M"  and modify whatever number is currently there
  3. Restart Tomcat using:
    shutdown.sh and then startup.sh

back to top
Was this Knowledgebase document helpful? Yes  No
The articles in this knowledgebase are intended for use by software programmers currently using an Adobe SDK to extend or customize an Adobe product. These articles may be highly technical in nature.
If you have questions about an Adobe Product that are not related to development or an SDK product please visit: http://adobe.com/support/main.html
Copyright © Adobe Systems Incorporated. All rights reserved.
Terms of Use
Online Privacy Policy