Re: Garbage collection
- From: Keith Thompson <kst-u@xxxxxxx>
- Date: Tue, 02 Oct 2007 20:43:24 -0700
John Nagle <nagle@xxxxxxxxxxx> writes:
Richard Tobin wrote:[...]
In article <1191279224.654464.215290@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
<rbj@xxxxxxxxxxxxxx> wrote:
I believe that the Committee should add garbage collection in the nextWhat exactly would this garbage collection be required to do?
version of the Standard.
A conservative collector (e.g. the Boehm collector) cannot reliably
collect all garbage (because there may be things that look like
pointers but aren't), and may discard non-garbage data if pointers
are encoded (e.g. when implementing other languages and putting
type bits in the low-order bits of a pointer).
This is a memory population issue. As the fraction of the
address space in use increases, the odds that a random value is
a valid address increases. This continues until the address
space is increased. Right now, we're in the worst part of the
cycle - machines have a few gigabytes of memory but are
mostly 32 bit, with 4 gigabytes of address space.
This was less of a problem in, say, the VAX era, when
machines had maybe 4MB of a 4GB address space, and most apps
were far smaller. Today, we routinely have applications with
a gigabyte or more of heap.
For 64-bit machines, this is much less of a problem.
The odds of a random value being in the first few gigabytes
of the address space are low.
Sure, but computer memory is not typically filled with random values.
It's likely that a *lot* of 64-bit integers will happen to hold
relatively small values. If valid memory addresses have non-zero
values only in, say, the bottom 33 or 34 bits, then you'll see more
arbitrary integers coincidentally matching memory addresses than you
would if everything were random.
If you can manage to set up your virtual memory so that valid memory
addresses aren't likely integer values, you can largely avoid this
problem.
--
Keith Thompson (The_Other_Keith) kst-u@xxxxxxx <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
.
- References:
- Garbage collection
- From: rbj
- Re: Garbage collection
- From: Richard Tobin
- Re: Garbage collection
- From: John Nagle
- Garbage collection
- Prev by Date: Re: Garbage collection
- Next by Date: Re: Garbage collection
- Previous by thread: Re: Garbage collection
- Next by thread: Re: Garbage collection
- Index(es):
Relevant Pages
|