User guide
Developing Java Applications
7-33
Objects in an Old generation area that are no longer required are recovered using FullGC processing.
The total memory size of the New generation area and the Old generation area is determined by the “-
Xmx” option that is specified when Java starts up. The default value is 64MB.
If the New generation area and Old generation area are insufficient (the number of objects is large), use
the Xmx option to increase the maximum value of the heap area. Specify the Xmx option in the JavaVM
option of the Interstage Management Console.
The GC “-verbose:gc” option can be set to check the extent to which the heap area is being used.
Example
The following is an output example when the “-verbose:gc” option is specified.
----------------------------------------------------------------------
[GC 80229K->31691K(259776K), 0.4795163 secs]
[FullGC 57654K->4623K(259776K), 0.3844278 secs]
(1) (2) (3) (4) (5)
----------------------------------------------------------------------
(1) This is the GC type (“GC” refers only to the New generation area; “FullGC” refers to the New, Old,
and Permanent generation areas).
(2) This is the size used for the heap (before GC).
(3) This is the size used for the heap (after GC).
(4) This is the heap size.
(5) This is the GC processing time.
The value in (2) is the amount used for the heap area.
Data for a heap area that is being executed can also be collected using “jheap”.
FJVM changes the New generation area and the Old generation area dynamically.
In HotSpot Server VM and HotSpot Client VM, the ratio for the New generation area and the Old
generation area is fixed. It is possible to change the ratio by specifying an option on startup. For details,
refer to the following website:
http://java.sun.com/docs/hotspot/VMOptions.html
Permanent Generation Area
In addition to the heap area that is managed by the maximum value in “-Xmx”, there is also a Permanent
generation area in the heap area for storing classes. An OutOfMemoryError error also occurs if this
area is insufficient.
The default value is 32MB in 1.3.1, and 64MB in 1.4.2.
The maximum value is determined by the “-XX:MaxPermSize” option that is specified when Java starts
up. For example, to set the maximum value of the Permanent generation area to 128MB, specify “-
XX:MaxPermSize=128m” in the option when Java starts up.
If an OutOfMemoryError error occurs even if the maximum value of the heap area in the “-Xmx” option is
increased, and the amount of heap area used appears to increase with time, there might be a memory
leak. In this situation, check the application.
“Qualyzer” can be used to investigate any possible memory leaks.