Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within OCPJP
Search Coderanch
Advance search
Google search
Register / Login
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
Tim Cooke
Liutauras Vilda
Jeanne Boyarsky
paul wheaton
Sheriffs:
Ron McLeod
Devaka Cooray
Henry Wong
Saloon Keepers:
Tim Holloway
Stephan van Hulst
Carey Brown
Tim Moores
Mikalai Zaikin
Bartenders:
Frits Walraven
Forum:
Programmer Certification (OCPJP)
Garbage Collection - Q
Alan Hermin
Ranch Hand
Posts: 290
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi all .. i am little confusing about GC() , take question:
class A{}
class Test{
void m1(){
Test
t=new Test(); //12
t.foo();
} //end method
}//end Test class
my question :if method m1() is called,is Test object refernced by t is elegible for Garbage Collection after method m1() complete ?
THANKS....
Vinayagar Karpagam
Ranch Hand
Posts: 72
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
What I think is, the Test object referenced by t will be eligible for garbage collection
if and only if "foo() doesn't give the reference of the Test object to any other
thread
alive in the program"
Alan Hermin
Ranch Hand
Posts: 290
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Thank
Vinayagar Karpagam
very much...
your answer erase my confusing.................
bye
tapan hoskeri
Greenhorn
Posts: 11
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
yes, I think that the object would be eligible for Garbage Collection, once the method m1 finishes execution.
Get off me! Here, read this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Garbage Collection Problem
Dan exam doubt 19
Passing Array as an Argument
garbage collection
Garbage Collection
More...