z/OS virtual storage
To debug these problems, you must understand how C/C++ programs, such as the JVM, use virtual storage on z/OS®. To do this, you need some background understanding of the z/OS Virtual Storage Management component and LE.
The process address space on 31-bit z/OS has 24-bit addressing that allows the addressing of up 16 MB of virtual storage, and 31-bit addressing that allows the addressing of up to 2 GB of virtual storage. The process address space on 64-bit z/OS additionally has 64-bit addressing that allows the addressing of over 2 GB of virtual storage. This virtual storage includes areas that are defined as common (addressable by code running in all address spaces) and other areas that are private (addressable by code running in that address space only).
The size of common areas is defined by several system parameters and the number of load modules that are loaded into these common areas. On many typical systems, the total 31-bit private area available is about 1.4 GB. From this area, memory resources required by the JVM and its subcomponents such as the JIT are allocated by calls to malloc(). These resources include: the Java™ native libraries, the Java heap (if you are using a 31-bit JVM), the Java classes (if you are using a 31-bit JVM or a 64-bit JVM with compressed references), memory that is required by application JNI code, and third-party native libraries.
A Java OutOfMemoryError exception typically occurs when the Java heap is exhausted, but can also occur when any of the private storage areas are depleted, for example if there are many threads. When large numbers of threads are used, native stack storage can often be the largest private storage area because LE requires a minimum of 3 MB for each thread in a 64-bit JVM. So 2,000 threads results in the allocation of 6 GB, or more, of storage. For more information about OutOfMemoryError exceptions, see Receiving OutOfMemoryError exceptions. For more information about z/OS storage allocation, see the UNIX System Services z/OS Version 2 Release 2 Implementation Redbooks® publication.