Database Reference
In-Depth Information
F IGURE 23-4 Minor garbage collection execution scenario causing the entire young genera-
tion area to be scanned
In the example Java object C is still alive and is therefore moved to survivor space 1 and
the Java object M in survivor space 1 is now moved to survivor space 2, as that is alive as
well. Java object T in survivor area 2 has been alive for a long time and meets the criteria to
be moved to the tenured (old) generation memory area. This increases the memory utiliza-
tion of the tenured (old) memory area.
Full Garbage Collection
The next scenario we will discuss covers the full garbage collection. In this scenario, as
shown in Figure 23-5 , Java object M is qualified to be promoted to the tenured memory
area, but this area is already full and a memory allocation error results. This leads to a full
garbage collection scenario where the entire heap area is scanned, which could take a con-
siderable amount of time. Full GC has some serious performance implications, and end
users will start seeing the Java application hanging and becoming unresponsive. This situ-
ation will last until the full GC process is completed and additional memory is freed up in
different memory areas of the JVM. It is ideal to tune the system to avoid full GC processes.
If there is no sufficient memory available, a full GC will eventually lead to out-of-memory
errors and may lead to the Java system ultimately crashing.
Search WWH ::




Custom Search