• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

Can any one explain Garbage Collection

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can any one explain Garbage Collection in detail.
 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi tejas,
im sure u kno a bit bout garbage collection and gc. but if u want it in detail refer 2 Peter van der linden,s just java pg 295-98 u might get what u want. then u might ask clarify ur doubts. byeee.
 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Tejas
check this out http://members.home.net/jgriscti/gc/behaviour.html
This will give a brief grasp on Garbage Collectior.
Cheers
Siva Prasad
 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Teja
Garbage Collection is the responsibility of JVM. It uses algorithms. Garbage collection is only about memory. You dont know when JVM performs garbage collection whenever processor is free garbage is performed.
example is.
public class ABC
{

public static void prt(String s)
{
System.out.println(s);
}


ABC()
{
this.prt("using this"); //it display 2nd
}

public static void main(String[] args)
{
prt("hello 2"); //first this display

ABC a=new ABC(); //constructor call

ABC b=new ABC();

ABC c=new ABC();

ABC d=new ABC();

System.gc();

System.runFinalization();

}

}
finalize is also used for observing the process of garbage collection. you should never call finalize().
moreover www.bruceeckel.com study chapter 04

------------------
 
If you're gonna buy things, buy this thing and I get a fat kickback:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic