This week's book giveaways are in the Jython/Python and Object-Oriented programming forums.
We're giving away four copies each of Machine Learning for Business: Using Amazon SageMaker and Jupyter and Object Design Style Guide and have the authors on-line!
See this thread and this one for details.
Win a copy of Machine Learning for Business: Using Amazon SageMaker and JupyterE this week in the Jython/Python forum
or Object Design Style Guide in the Object-Oriented programming forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

Garbage collection

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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
  • Quote
  • Report post to moderator
Thanks Guys , you were of great help
Rachel
 
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
THanks Bharatesh
 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • 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
  • 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!
 
So there I was, trapped in the jungle. And at the last minute, I was saved by this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!