Understanding Memory Usage
To debug memory leaks, you need to understand the mechanisms that can cause memory problems, how the JVM uses the LE HEAP, how the JVM uses z/OS® virtual storage, and the possible causes of a java.lang.OutOfMemoryError exception.
Memory problems can occur in the Java™ process through the
following mechanisms:
- A Java object leak in the Java-managed heap. The leak is caused by programming errors in the application or the middleware. These object leaks cause an increase in the amount of live data that remains after a garbage collection cycle is completed.
- Incorrect Java heap size. For example, the heap size might be too small for the amount of storage that is required by the application. However, an excessively large heap size can result in a lack of MVS private area storage for other components, such as the native thread stack. Use the -Xmx option to optimize the heap size for your application and environment.
- Under-allocation of storage areas. For example, if the REGION, MEMLIMIT, or MAXTHREADS parameters are set too low, or if storage areas are in contention with storage areas for other products, such as IBM® CICS®.