top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

What are generations in garbage collector?

0 votes
What are generations in garbage collector?
posted Apr 4, 2017 by Rohini Agarwal

Share this question
Facebook Share Button Twitter Share Button Google+ Share Button LinkedIn Share Button Multiple Social Share Button

1 Answer

0 votes

Short-lived objects are stored in the first generation, generation 0.
The longer-lived objects are pushed into the higher generations, 1 or 2.
The garbage collector works more frequently in the lower generations than in the higher ones.
When an object is first created, it is put into generation 0

answer Apr 17, 2017 by Shweta Singh
Contact Us
+91 9880187415
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Karnataka INDIA.