For Sun/Oracle's JVM, I've read that the GC algo divides new generation into one Eden region and two survivor regions. What I'm wondering about is, why two survivor regions and not just one? The algo can keep ping-ponging between Eden and just one survivor region (the way it currently does between two survivor regions); or are there any shortcomings to this approach?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
Young Generation : It is place where lived for short period and divided into two spaces:
Eden space : New objects will be allocated in the memory pool. The assumption is that most object get dereferenced and become unreachable soon after their creation. Objects not being dereferenced will be copied by the new generation garbage collector into the survivor spaces. They may get copied n some special cases directly into the old generation pool.
Survivor spaces: These two small spaces keep the surviving objects of a young generation garbage collection. Surviving objects will be copied for a (small) number of times from one survivor into the other. This allows to harvest our more dereferenced objects.
Old generation: The largest memory pool which should keep the long living objects. Objects are getting copied into this pool once they leave the survivor spaces.
Permament generation: This fairly unknown pool keeps the information of all the classes. It doesn't need any attention for most applications. It may need to be adapted for some applications with many classes. It may need some attentention as well if the application permanently loads and unloads classes.
Other advantages:
Please find the following links for more details which can help you understand more
http://www.scalingbits.com/javaprimer
http://java.sys-con.com/node/84695