-
Junior Member
when is an object ready to be garbage collected
when is an object ready to be garbage collected by the compiler.is it the same way all the time
-
Junior Member
Re: when is an object ready to be garbage collected
Which the object is no longer needed in a particular application,that time tat object will be garage collected
-
Junior Member
Re: when is an object ready to be garbage collected
Garbage collector is usefull to overcome memory crashes.so whenever it thinks any object is not usefull then it will be removed from the memory so it is collected by garbage collector
-
Junior Member
Re: when is an object ready to be garbage collected
Any Object that is not accessble by any LIVE thread(i.e active thread) then the garbage collector calls the finaliz() method on that object to release the acquired resourec before garbage collecting the Object.Once resorces released then the object is garbage collected .Pls feel free to ask for further expalnation.
Last edited by srini235; 05-16-2008 at 02:07 AM.
-
Junior Member
Re: when is an object ready to be garbage collected
@srini235
But what if other threads are referring to that object somehow?
-
Junior Member
Re: when is an object ready to be garbage collected
There are different implementation for garbage collection, one popular method is mark-and-sweep algorithm, where jvm puts objects in a graph, and traverse the graph based on if live thread exists from one object to other object. If there is no live thread, then jvm "mark" the object, and then "sweep" it off graph. Hence, the name is "mark-and-sweep".if there are other threads referring to the same object, then it won't be allocated. There are also ome advanced garbage collection implementation. You can read it in advanced java book senior computer science engineering student donald bren of information and computer science
university of california, irvine
-
Junior Member
Re: when is an object ready to be garbage collected
Which the object is no longer used
-
Junior Member
Re: when is an object ready to be garbage collected
when resoures linked with that object are not required for later
-
Junior Member
Re: when is an object ready to be garbage collected
everything is ok with garbage collector but a little doubt is there
can we see the object functionality after removing from memeoiry
-
Junior Member
Re: when is an object ready to be garbage collected
when there is no refrence pointing to that object& the object remains unreachable
Last edited by encapsulation; 06-02-2008 at 10:21 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules