029, manufacturers face questions: How it works Latest G1 garbage collector, can you talk?

 
 This article is a personal learning "from 0 to take you to become a master JVM real" content summary details of the two-dimensional code scanning
 
1, ParNew + combination CMS gives us what pain points?
 
  STW, G1 garbage collector - better than the performance of garbage collection
2, G1 garbage collector
  G1 while recovering objects and old Cenozoic era, the java heap is split into a plurality of equal size Region . The most important feature : You can set the garbage collection 'expected pause time', G1 solely responsible to achieve this goal, and to control the impact on the performance of the recovery
 
3, G1 is how to do on the system caused by garbage collection pause controllable?
 
1- split into memory by the large number of small Region. 2- track recovery value of each Region - how many garbage, recycling garbage estimate how many of these time-consuming. 3- garbage collection in the set time, select the best recycling value recovered
? ? Expressed in 'Set expected dwell time', G1 solely responsible to ensure that achieve this goal, followed by the expression 'try to control at the specified time frame,' Will there will be recovery timeout phenomenon it?
A: hardly
? ? If within the specified time, the recovered space can not meet the space requirements of the new object will happen? Continue to trigger the recovery is still oom
A: Continue to trigger recovery
    
4, Region may belong to the new generation may belong years old  
  Old and the new generation's own memory area is constantly changing, from G1 automatic control.  
? ? State transition: the old and the new generation's own memory area is non-stop change, the new generation becomes understandable years old, years old will become the new generation of it? I guess it should not be, might Region's old space full recovery is over, may become the initial state from the old year (not a new non old), and then a new generation, the cycle of reincarnation.
A: Yes, G1 where everything can be changed, Region are dynamic and flexible, a Region is recovered out after emptying of refuse (copied to another Region), the back can continue to flexibly assigned.
My answer: Region after empty properties will change generational

Guess you like

Origin www.cnblogs.com/csldm/p/11306489.html