garbage collection

Discussion in 'Java' started by steve, Dec 15, 2003.

  1. steve

    steve Guest

    anyone have a url for a good functional comparison between deterministic and
    non-deterministic object finalization...pros and cons for each?

    tia,

    steve
    steve, Dec 15, 2003
    #1
    1. Advertising

  2. steve

    Adam Jenkins Guest

    steve wrote:
    > anyone have a url for a good functional comparison between deterministic and
    > non-deterministic object finalization...pros and cons for each?


    I assume by deterministic finalization, you mean something like C++
    destructors, where there is a well defined place in the program that the
    destructor will be called, and non-deterministic finalization is like
    Java finalizers, where the program has no direct control over if or when
    the finalizer will be called.

    For deterministic finalization to work, you either need the compiler to
    be able to determine where an object's lifetime ends, as in C++, or use
    a automatic reference-counted memory management scheme, such as in Perl
    or Python. I don't believe deterministic finalization is compatible
    with non-reference-counted garbage collection, since only the garbage
    collector can determine when there are no more references to an object.
    To make a garbage collected language like Java call finalizers as soon
    as the last reference went away, you'd need to synchronously call the
    garbage collector every time a reference value was changed, which would
    be horribly inefficient.

    So maybe a good starting point for you would be to research the relative
    advantages of garbage collection, automatic reference counting, and
    manual memory management schemes.

    Adam
    Adam Jenkins, Dec 16, 2003
    #2
    1. Advertising

  3. steve

    steve Guest

    thanks adam, that's exactly what i mean. do you have any good url links re.
    the "swat" of both?

    steve
    steve, Dec 16, 2003
    #3
  4. steve

    Adam Jenkins Guest

    I think the pros and cons of any sort of automatic memory management
    versus manual memory management are pretty obvious for the most part.
    As for comparing different automatic memory management techniques, this
    page has some good links. Specifically check out the GC FAQ, which has
    a section on finalization. It also has a large bibliography of papers
    relating to GC

    http://www.cs.kent.ac.uk/people/staff/rej/gc.html

    Hope that helps.
    Adam

    steve wrote:
    > thanks adam, that's exactly what i mean. do you have any good url links re.
    > the "swat" of both?
    >
    > steve
    >
    >
    Adam Jenkins, Dec 16, 2003
    #4
  5. steve

    steve Guest

    thanks again adam. it is much appreciated.
    steve, Dec 16, 2003
    #5
  6. steve

    Chris Smith Guest

    steve wrote:
    > thanks adam, that's exactly what i mean. do you have any good url links re.
    > the "swat" of both?


    Steve,

    The only real "con" of deterministic finalization is that it's not
    feasible with high-performance garbage collection techniques. Anything
    else is in favor of deterministic finalizers, but that performance issue
    alone is often enough to tip the scales.

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

    Chris Smith - Lead Software Developer/Technical Trainer
    MindIQ Corporation
    Chris Smith, Dec 18, 2003
    #6
    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:
    700
    Gaurav Khanna [C# MVP]
    Jan 27, 2004
  2. Cheung, Jeffrey Jing-Yen
    Replies:
    3
    Views:
    1,537
    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,349
    cjohn
    Aug 20, 2009
  4. Replies:
    1
    Views:
    431
    mrstephengross
    Jul 25, 2005
  5. Øyvind Isaksen
    Replies:
    1
    Views:
    948
    Øyvind Isaksen
    May 18, 2007
Loading...

Share This Page