• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Garbage collection

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Everybody!
I just wanted to know that where can i find a suitable matter regarding Garbage collection that is needed for certification.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Rachel Malhotra:
Hi Everybody!
I just wanted to know that where can i find a suitable matter regarding Garbage collection that is needed for certification.


Dear
The best way to know about Garbage Collection is to visit this site daily & see the questions of GC,u can easily understand this topic.

Because in every book they write little bit, but i can find good enough in Mughal Khalid Azims book.
Best Luck
 
Ranch Hand
Posts: 3141
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Rachel,
I have some notes on Garbage collection posted at http://webhome.idirect.com/~jgriscti/gc.html.
Hope they help.
------------------
Jane
The cure for boredom is curiosity.
There is no cure for curiosity.
-- Dorothy Parker
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Rachael,
You may find following link useful. It is the free book by Bruce Eckel on the web.
http://www.eckelobjects.com/
Hope this helps
-Sandeep
------------------
Visit my homepage : www.tipsmart.com
 
Rachel Malhotra
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Guys , you were of great help
Rachel
 
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What I have analysed from the recent reviews here is there is utmost one question on GC. It is usually that at which line is the Object eligible for GC. This is given in a method.
The following are the scenarios :
[CODE]
public void GCmeth(Object x)
{
Object x = new Object();
String s = new String("Garbage Collection");
x = s;
x = null; // Is it this line ? NO.
} // It is after this line
public void GCmeth2()
{
String s = new String ("GC is platform dependent");
String t = s;
s = null; // Is it this line? YES
} // Is it this line ?
[CODE]
HTH
 
Rachel Malhotra
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
THanks Bharatesh
 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Bharatesh,

In the first example code the object was GCed after the line it became null. But in the second one the object was GCed in the same line where it became null. Why is it different in both cases. It is because in the first case the object was passed as a parameter to that method? Is that the reason?
thank u
rajani
 
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi Bharatesh,
I have some confusions about the code
[CODE]
public void GCmeth(Object x)
{
Object x = new Object();\\line1
String s = new String("Garbage Collection");\\line2
x = s;// the object created on line1 has no referance so it should be eligible for gc
x = null; // the string created on line2 has lost its referance so it should be eligible for gc
}

public void GCmeth2()
{
String s = new String ("GC is platform dependent");//line1
String t = s;// no new string has been created
s = null; // the string created on line 1 is still pointing to t i.e.still got a referance
}// it should be eligible for gc here..
[CODE]

please clarify!
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic