Linked by Zachary Pinter on Tue 27th Apr 2004 17:09 UTC
General Development Garbage collection (GC) is a technology that frees programmers from the hassle of explicitly managing memory allocation for every object they create. Traditionally, the benefit of this automation has come at the cost of significant overhead. However, more efficient algorithms and techniques, coupled with the increased computational power of computers have made the overhead negligible for all but the most extreme situations.
Permalink for comment
To read all comments associated with this story, please click here.
Re: I don't agree with..
by murphee on Tue 27th Apr 2004 19:05 UTC

>off the disk. However, mark and sweep gc routines require
>that all this data is constantly being swapped back into
>memory for the sole purpose of garbage collection.

What do you mean by "constantly"? If you use a generational
GC (which is the default on the Sun Java VMs), most GC runs
happen in the nursery or eden space (the new generation).
This generation does not use Mark/Sweep;
The Old generation does, but GC runs happen much less
often there.
And even that overhead can be reduced to nothing; there
is research on the topic "Pre-Tenuring", which recognizes
extremely long lived data and optimizes GC for those
(see this paper:
http://cs.anu.edu.au/~Steve.Blackburn/pubs/papers/pretenure-oopsla-...
for details);

>This is why java swing programs seem so slow.

What the...? What kind of statement is that?
How does the occasional swapping of data concern the
perceived speed of GUI apps? And yes, it is
*occasional*, because most of the GC runs happen
on the young generation (again: no mark/sweep there)
and not the old generation.
If you feel your
Swing apps run too slowly, use the "Concurrent" setting
on the JVMs GC to keep GC pauses down to a minimum,