- Stop-the-world : Pauses all active threads to perform garbage collection.
- GC tuning often means reducing this stop-the-world time
- Some people sets the relevant object to null or use System.gc() method to remove the memory explicitly. Setting it to null is not a big deal, but calling System.gc() method will affect the system performance drastically, and must not be carried out.
- This garbage collector was created based on the following two hypotheses. (It is more correct to call them suppositions or preconditions, rather than hypotheses.)
- These hypotheses are called the weak generational hypothesis. So in order to preserve the strengths of this hypothesis, it is physically divided into two - young generation and old generation - in HotSpot VM.
- Young generation: Most of the newly created objects are
located here. Since most objects soon become unreachable, many objects
are created in the young generation, then disappear. When objects
disappear from this area, we say a "minor GC" has occurred.
Old generation: The objects that did not become unreachable and survived from the young generation are copied here. It is generally larger than the young generation. As it is bigger in size, the GC occurs less frequently than in the young generation. When objects disappear from the old generation, we say a "major GC" (or a "full GC") has occurred.
Friday, May 17, 2013
Java GC
http://www.cubrid.org/blog/dev-platform/understanding-java-garbage-collection/#stop-the-world
Subscribe to:
Comments (Atom)