how garbage collection works

Discussion in 'Java' started by sam, Nov 12, 2005.

  1. sam

    sam Guest

    can anybody tell me how garbage collection works
    sam, Nov 12, 2005
    #1
    1. Advertising

  2. sam wrote:

    > can anybody tell me how garbage collection works


    Yes*. Whether they will be willing to spoon feed the information
    to you, is another matter.

    What do you know so far? What is your specific question or
    current understanding?

    * My answer is 'pretty well - so long as you don't hang on
    to references to objects', but ..there are other answers.
    Andrew Thompson, Nov 12, 2005
    #2
    1. Advertising

  3. sam

    Roedy Green Guest

    On 11 Nov 2005 19:15:21 -0800, "sam" <> wrote,
    quoted or indirectly quoted someone who said :

    >can anybody tell me how garbage collection works


    see http://mindprod.com/jgloss/gc.html
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Java custom programming, consulting and coaching.
    Roedy Green, Nov 12, 2005
    #3
  4. sam

    Chris Smith Guest

    sam <> wrote:
    > can anybody tell me how garbage collection works


    Good question. There's no possible way someone from USENET could answer
    it suitably. If you want to know, there are two sources of information
    that I'd recommend:

    A book:

    Garbage Collection: Algorithms for Automatic Dynamic Memory Mgmt
    Richard Jones and Rafael Lins

    A paper:

    Uniprocessor Garbage Collection Techniques
    Paul Wilson
    Expanded version, ACM Computing Surveys
    ftp://ftp.cs.utexas.edu/pub/garbage/bigsurv.ps

    --
    www.designacourse.com
    The Easiest Way To Train Anyone... Anywhere.

    Chris Smith - Lead Software Developer/Technical Trainer
    MindIQ Corporation
    Chris Smith, Nov 12, 2005
    #4
  5. sam

    Chris Smith Guest

    > sam <> wrote:
    > > can anybody tell me how garbage collection works


    Incidentally, I assume you meant "Can anyone tell me the programming
    techniques used to implement garbage collection, in general?"

    It's possible you meant something else by your questions. For example:

    * What is garbage collection?
    * What behavior should I expect to observe from GC in Java?
    * I'm an expert in GC and need the techniques used by the JVM.

    In these cases, you won't find help in any of the sources I mentioned.
    Neither of them even mentions Java, to the best of my knowledge, so they
    can't speak to the spec's guaranteed behavior nor to any implementations
    of the Java platform. They also assume you already know what garbage
    collection is.

    If you meant one of the other questions and no other answers help,
    please feel free to let us know.

    --
    www.designacourse.com
    The Easiest Way To Train Anyone... Anywhere.

    Chris Smith - Lead Software Developer/Technical Trainer
    MindIQ Corporation
    Chris Smith, Nov 12, 2005
    #5
  6. sam

    Roedy Green Guest

    On Fri, 11 Nov 2005 20:43:20 -0700, Chris Smith <>
    wrote, quoted or indirectly quoted someone who said :

    >Good question. There's no possible way someone from USENET could answer
    >it suitably. If you want to know, there are two sources of information
    >that I'd recommend:


    It is not odd that people who understand the intricacies of Garbage
    Collection algorithms are considered the acme of programmers.
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Java custom programming, consulting and coaching.
    Roedy Green, Nov 12, 2005
    #6
  7. sam

    Chris Uppal Guest

    Chris Uppal, Nov 12, 2005
    #7
  8. sam

    Roedy Green Guest

    On Sat, 12 Nov 2005 10:40:24 -0000, "Chris Uppal"
    <-THIS.org> wrote, quoted or indirectly
    quoted someone who said :

    >http://groups.google.com/group/comp.lang.java.programmer/msg/7889879d8cbb089f
    >
    >This you /aren't/ looking for a simple answer, then Chris Smith has already
    >covered the bases.


    ut in Java, we have a Garbage Collector. This is a little dude in
    overalls that climbs down a special Staff Only Thread, sweeps up all
    the broken Objects on the floor, and shovels them into the
    incinerator. You never know exactly when he's going to come along,
    but he's always there keeping an eye on the mess on the floor to make
    sure that it doesn't fill up too much...

    The problem is the objects DON'T naturally fall to the floor. GC is
    about tracing the root to the branches to see what is still alive.
    Perhaps a copy collector would be easier to understand, copying only
    the objects still properly attached to a new room, shaking off the
    dead wood, then turning on a blast furnace in the old one to vaporise
    anything in it.

    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Java custom programming, consulting and coaching.
    Roedy Green, Nov 12, 2005
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Laser Lu

    Garbage Collection and Manage Code?

    Laser Lu, Jan 26, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    711
    Gaurav Khanna [C# MVP]
    Jan 27, 2004
  2. Cheung, Jeffrey Jing-Yen
    Replies:
    3
    Views:
    1,549
    Cheung, Jeffrey Jing-Yen
    Jul 10, 2003
  3. IDoNothing

    Garbage Collection in ASP.NET

    IDoNothing, Jan 9, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    8,362
    cjohn
    Aug 20, 2009
  4. Replies:
    1
    Views:
    439
    mrstephengross
    Jul 25, 2005
  5. Øyvind Isaksen
    Replies:
    1
    Views:
    964
    Øyvind Isaksen
    May 18, 2007
Loading...

Share This Page