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 native (C/C++) memory leak that causes increased usage of the LE HEAP (31-bit VMs only), which can be seen as excessive usage of Subpool2, Key 8, or storage, and an excessive Working Set Size of the process address space
- 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®.