how garbage collection works

A

Andrew Thompson

sam said:
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.
 
C

Chris Smith

sam said:
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
 
C

Chris Smith

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
 
R

Roedy Green

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.
 
R

Roedy Green

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.
 

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,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top