Re: [PATCH 2/2] ruby: enable garbage collection using talloc

Subject: Re: [PATCH 2/2] ruby: enable garbage collection using talloc

Date: Sat, 26 Jun 2021 13:56:38 -0500

To: David Bremner

Cc: notmuch@notmuchmail.org, Tomi Ollila

From: Felipe Contreras


On Thu, Jun 10, 2021 at 7:46 PM David Bremner <david@tethera.net> wrote:
>
> Felipe Contreras <felipe.contreras@gmail.com> writes:
>
> > We basically steal all the objects from their notmuch parents, therefore
> > they are completely under Ruby's gc control.
> >
> > The order at which these objects are freed does not matter any more,
> > because destroying the database does not destroy all the children
> > objects, since they belong to Ruby now.
>
> I guess from a purist point of view this is a kind of layering
> violation, since the use of talloc is purportedly an internal
> implementation detail of the library. Still, I think it's a reasonable
> approach given that the ruby bindings are maintained as part of notmuch,
> and we are not very likely to abandon talloc.

Yes, some refcount API could be added to all the notmuch objects, but
at least I couldn't get talloc refcount stuff work for Ruby, so more
work would be needed for that.

> I am OK with applying the series as is. The only sensible thing I can
> think of at the moment for testing is to run something like the script
> of id:20210517193915.1220114-1-felipe.contreras@gmail.com as a "time
> test", so not attempt to get valgrind working, but just run it on some
> decent size corpuses and see that it it does not crash or leak too much
> memory to complete.

I have the test ready, the only question is how many times to run it
in a loop. 100 times takes about 10 minutes with the large corpus
size.

-- 
Felipe Contreras
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: