Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Garbage Collection Implemention Questions

 
Edward Chen
Ranch Hand
Posts: 798
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Henry Wong wrote:
A copy collector splits the heap in half and move objects between the two halves during the GC cycle. And yes, "it will cost a lot".

The theory behind using a copy collector for the new generation objects, is that most objects do not last very long.



We divide objects into young generation and tenured generation. Question is, how to divide ? Yes, the object defined inside a method definitely is short lived, should be in young generation. My coding above is not this case, so local object is not our topic here.

Objects defined in the instance level, how to divide them into young generation and tenured generation ?


Thanks.
 
Henry Wong
author
Marshal
Pie
Posts: 21195
81
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it would be a good idea to start a new topic... In fact, let me start one for you.... DONE.

This topic has been spun off from here... http://www.coderanch.com/t/520071/java/java/detect-memory-leak

Henry
 
Henry Wong
author
Marshal
Pie
Posts: 21195
81
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All objects, that are instantiated on the heap, goes to the new generation portion of the heap. After a few new generation GC cycles, depending on configuration, they should be promoted to the old generation portion of the heap.

Now, if you want to know how the GC is configured, then you should google for a java GC tuning guide.

Henry
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic