Results 1 to 10 of 10

Thread: when is an object ready to be garbage collected

  1. #1
    Junior Member
    Join Date
    Mar 2008
    Answers
    2

    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


  2. #2
    Junior Member
    Join Date
    Dec 2007
    Answers
    5

    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


  3. #3
    Junior Member
    Join Date
    Mar 2008
    Answers
    7

    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


  4. #4
    Junior Member
    Join Date
    May 2008
    Answers
    2

    Thumbs up 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.

  5. #5
    Junior Member
    Join Date
    Nov 2006
    Answers
    5

    Re: when is an object ready to be garbage collected

    @srini235
    But what if other threads are referring to that object somehow?


  6. #6
    Junior Member
    Join Date
    May 2008
    Answers
    3

    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


  7. #7
    Junior Member
    Join Date
    May 2008
    Answers
    1

    Re: when is an object ready to be garbage collected

    Which the object is no longer used


  8. #8
    Junior Member
    Join Date
    May 2008
    Answers
    7

    Re: when is an object ready to be garbage collected

    when resoures linked with that object are not required for later


  9. #9
    Junior Member
    Join Date
    May 2008
    Answers
    1

    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


  10. #10
    Junior Member
    Join Date
    Jun 2008
    Answers
    1

    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
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact