garbage collection

S

steve

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

tia,

steve
 
A

Adam Jenkins

steve said:
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
 
S

steve

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

steve
 
A

Adam Jenkins

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
 
C

Chris Smith

steve said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top