English

Problem: Inconsistent behavior from applications that use the geometry library

Description

An ArcSDE 8.1 Java API application using the geometry library behaves inconsistently when executed. The application might intermittently fail to execute or throw a Java run time exception. The shape objects returned by the geometry functions could also be different each time the application is run.

Cause

Insufficient memory settings for the Java run time environment.

Solution or Workaround

We recommend at least 5 megabytes of run time memory for the Java application. You can change the Java run time memory settings with the run time command option:

Code:
java –ms5m –mx25m <java_class_name>


Note:
Each JVM implementation has its own minimum and maximum memory requirement. It is recommended that this requirement be met.


Note:
You should use the -verbosegc command line option to monitor your application's heap activity. If you notice a large number of garbage collections are occurring, increase the heap size as much as possible without causing excessive page faults. If your application is page faulting excessively, do the following:

¤ Lower the -mx value.

¤ Increase process quotas based on the amount of available physical memory.

¤ Add physical memory

It is better to have a smaller heap that results in more garbage collections than to allow your application to page fault too often due to a large heap size.