Current Status
Godmar Back
gback@cs.utah.edu
Thu Apr 1 00:00:00 GMT 1999
>> On 1999年2月18日, Godmar Back wrote:
>> >In Kaffe, we use 19 freelists (i.e., 19 sizes) at this time, so the worst
> >case overhead is less than 76K on a 4K ppage architecture such as the x86
> >for wastage of type 1.
> >
>> I think that this ignores the fact that garbage collection can leave multiple
> unfilled blocks for a given size. A given block of objects can only be recycled
> to contain blocks of a different size once ALL of the objects in that block
> have been collected. In a perverse case, you might have several 4K blocks
> each having only a single 16-byte object.
>
This is true.
However, I haven't found this to be a problem in practice yet.
But it certainly opens the possibility for fragmentation attacks by
malicious code. I would say it's unlikely that "normal" applications
would exhibit an allocation pattern that would make this a problem.
Increasing the frequency of gc may counteract this some since the empty
slots are reused (albeit only for objects of the same size) as soon as
you collect garbage and mark them free.
Note that I don't want to defend it in any way: I too would rather have
a copying or mostly copying collector for Kaffe.
- Godmar
More information about the Java
mailing list