[Gc] using a lot of finalizers?

Basile Starynkevitch <[email protected]> Wed, 25 May 2016 10:20:32 +0200
Newsgroups gmane.comp.programming.garbage-collection.boehmgc
Message-ID <[email protected]>
Hello,

In my MELT monitor (see https://github.com/bstarynk/melt-monitor-2015/ 
for details) I am having a lot finalizers. You might consider (GC-wise) 
that it is sort-of some Lisp (but multi-threaded, with a small thread 
pool of about half a dozen threads) interpreter.

Basically, I have (conceptually) a lot of immutable GC-ed values 
(allocated with GC_MALLOC) and some mutable GC-ed "items" (also 
allocated with GC_MALLOC). Those items are registering a finalizer with 
GC_REGISTER_FINALIZER_IGNORE_SELF at creation time.

In the event I would have a large (e.g. a dozen of gigabytes) GC heap, 
is it acceptable to have many (e.g. half a million) of items with 
finalizers and much more (e.g. several millions) values.

So my question becomes: can I have many items, each having registered a 
finalizer, or is it not acceptable performance-wise?

Or should I put a lot of design effort to avoid finalizers?

My blind guess is that since "gc/gc_cpp.h" is using 
GC_REGISTER_FINALIZER_IGNORE_SELF it should be acceptable to have a lot 
of finalizers.

Regards.

-- 
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mine, sont seulement les miennes} ***