This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: GC incremental
- To: Jeff Sturm <jsturm at one-point dot com>
- Subject: Re: GC incremental
- From: minyard at acm dot org
- Date: 01 Oct 2001 09:35:01 -0500
- Cc: Bryce McKinlay <bryce at waitaki dot otago dot ac dot nz>, "Boehm, Hans" <hans_boehm at hp dot com>, "'Antonio Ake '" <ake at ecn dot purdue dot edu>, "'java at gcc dot gnu dot org '" <java at gcc dot gnu dot org>
- References: <Pine.LNX.4.10.10110010039090.14760-100000@mars.deadcafe.org>
- Reply-To: minyard at acm dot org
Jeff Sturm <jsturm@one-point.com> writes:
> > And locking can only occur for a minimum of page, so
> > even if your data doesn't have any pointers, some data beside it
> > might.
>
> I was imagining an allocation scheme in which every page would consist
> entirely of ptrfree objects, or none at all. Since each object type has
> its own free list, it doesn't seem very difficult.
True. That's actually how both Boehm's and my GC works, I think.
>
> > And all GCJ objects have pointers, BTW, even arrays.
>
> True. But the static vtable of a primitive array can be ignored for
> marking purposes. From prim.cc:
>
> # ifdef JV_HASH_SYNCHRONIZATION
> // Since the vtable is always statically allocated,
> // these are completely pointerfree! Make sure the GC doesn't touch them.
> __JArray *arr =
> (__JArray*) _Jv_AllocPtrFreeObj (size + elsize * count, klass);
> memset((char *)arr + size, 0, elsize * count);
> # else
The vtable can't be ignored in the long run if classes are ever
unloaded dynamically, and the sync pointer can't be ignored (unless it
has been moved out of the object, which I think there was some
discussion of, but I haven't checked the new sources).
You could have the array object have a pointer to the actual block of
data instead of the data being allocated as part of the object, that
way the array data would be allocated separately (and could be pointer
free). It wouldn't be too hard to do that if everything in libgcj
uses the standard array access macros/inlines, which I think is the
case. It would break binary compatability pretty severly.
-Corey