User guide
Chapter 7: Developing Applications
7-32
An OutOfMemoryError error typically occurs in this situation.
The memory used in Java can be broadly divided into the following three categories:
− New generation area
− Old generation area
− Permanent generation area
• The amount of virtual memory is insufficient
An OutOfMemoryError error may also occur if the system virtual memory outside the heap area is
insufficient. In this situation, increase the virtual memory.
If a thread cannot be generated because the virtual memory is insufficient, an OutOfMemoryError
error containing the following information occurs.
java.lang.OutOfMemoryError: unable to create new native thread
• The Java process user space is insufficient
Even if there is enough room in the heap area or system virtual memory, an OutOfMemoryError
error might occur if the upper limit for the memory determined by the OS for each process is
exceeded. This is particularly the case if, when a thread is generated, memory is secured in a
different area to the heap area. If a large number of threads is generated, the secured memory
exceeds the upper limit determined by the OS, causing the thread generation to fail, and an
OutOfMemoryError error containing the following information to occur.
java.lang.OutOfMemoryError: unable to create new native thread
In this situation, take the following action:
− To generate a thread in the Java program, reduce the number of thread generations.
− If the error is output along with message IJServer17654 in the IJServer WorkUnit container log,
check that the value set for the number of simultaneous processing events in the WorkUnit
Servlet container is not too large. If it is too large, reduce it. In this situation, the IJServer
process concurrency can be increased to maintain the number of requests (number of
simultaneous processing events x process concurrency) that can actually be processed
simultaneously in one WorkUnit, if required. However, if the process concurrency is increased
unnecessarily, it will use up a considerable amount of system memory.
− If the Java process heap area is excessively large, the value specified for the Java command -
Xmx option can be reduced to relieve the upper limit.
− If the Java process stack size is excessively large, reduce the stack size using the ulimit
command (B shell type) or the limit command (C shell type).
New Generation Area and Old Generation Area
The New generation area and Old generation area are areas for managing objects such as instances
and arrays. Areas are divided into New and Old generations so that garbage collection (GC) processing
for the generations can be executed separately.
The New generation area manages objects with short life spans. An object for which a request for
generation has occurred in a Java program is typically generated in the New generation area.
Objects that have been in a New generation area for a fixed period of time are moved to the Old
generation area.