[Mono-devel-list] Precise allocation / leaking vtables

Paolo Molaro lupus at ximian.com
Thu Jul 21 13:01:17 EDT 2005

On 07/19/05 Ben Maurer wrote:
> Miguel wanted a patch that would give us precise (ie, gcj style)
> allocation in all domains, even if it means that we need to leak
> vtables.
> The attach patch makes this tradeoff. Miguel's logic is that the use of
> unloading is relatively rare compared to the use of xsp, etc, which make
> large amounts of allocations outside of the root domain.

Well, now that you have a patch, run the tests and see if there is
any improvement.
I already did a while ago the changes to make the arrays ptrfree when
possible and they are the biggest source of data that could make the GC
behave badly (besides the stacks). The improvement was there, but
it was relatively small. My feeling is that the extra mile will bring
little or no benefit. Introducing a leak is a very bad idea, IMHO.

> One other option would be to do a full gc during app domain unloading
> and then install some sort of in libgc that would remove objects in the
> doomed domain. This is basically what msft does (according to one of
> cbrumme's logs). However, because they have a precise gc, they *know*
> that all objects in the doomed domain will die and don't have to add any
> extra code to enforce that.

We don't need to remove the objects, we just need to change their vtable
pointer to a vtable that the GC can use and that tells it there are
no pointers in the object anymore (and we need to remove them from the
finalizer queue).
Of course, this is likely to trigger bugs elsewhere...


lupus at debian.org                                     debian/rules
lupus at ximian.com                             Monkeys do it better

More information about the Mono-devel-list mailing list