English

Error: Getting a Java heap size error for the ADF application (java.lang.OutOfMemoryError)

Error Message

When viewing a Java Web mapping application created, using the ArcGIS Server Java Web Manager, the following errors may occur:

java.lang.OutOfMemoryError: PermGen space
java.lang.OutOfMemoryError: Java Heap Space

These errors are generally found in the ArcGIS Server Manager logs; for example: manager_stdout.txt, manager_stderr.txt, which is located in the $AGSHOME/java/manager/service/logs directory.

Note:
$AGSHOME refers to the ArcGIS Server installation directory.

Cause

The Java Virtual Machine (JVM) hosting the Web mapping application has reached the maximum allowed limit for PermGen memory.

Note:
ArcGIS Server provides an out-of-the-box Apache Tomcat Web server (running on port 8399) for hosting the Web applications and by default, the JVM memory size is limited. This version of Tomcat is bundled with ArcGIS Server and is referred to as 'internal Tomat' in this article.


There are several operations that can lead to an error associated with the Java heap size. Examples of a few such operations are provided below:
- Hosting a very large number of Web applications on the internal Tomcat.
- In the Web application, identifying a feature with a high number of vertices.
- Accessing a map service that contains a very high number of layers.

Solution or Workaround

Increase the maximum limit for PermGen Memory for the internal Tomcat JVM.

Note:
This feature is only available in ArcGIS Server 9.2 with Service Pack 4, and is also included in the future releases.

Step-by-step instructions are provided below:

  1. Stop the ArcGIS Server services. For Solaris and Linux, see the topic "Start or Stop ArcGIS Server on Solaris and Linux" in the Related Information below. For Windows, launch the Windows Services console and stop the ArcGIS Server Manager Service and the ArcGIS Server Object Manager Service.
  2. Open the file $AGSHOME\java\manager\service\lib\manager_config.properties in a text editor.
  3. Update the value of JVM property MaxPermSize to reflect a higher number. An example is provided below:
    Code:
    managerappserver.jvm.options=-Xms256m -Xmx256m -XX:MaxPermSize=1024m

  4. Start the ArcGIS Server services afterwards. For Solaris and Linux, see the topic "Start or Stop ArcGIS Server on Solaris and Linux" in the Related Information. For Windows, launch the Windows Services console and start the ArcGIS Server Manager Service and the ArcGIS Server Object Manager Service.

Related Information