From: Igor Munkin via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Sergey Bronnikov <sergeyb@tarantool.org>
Cc: Maksim Kokryashkin <max.kokryashkin@gmail.com>,
tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH luajit v2] test: fix flaky OOM error frame test
Date: Mon, 20 Nov 2023 14:53:22 +0000 [thread overview]
Message-ID: <ZVty4swlySaFUjr0@tarantool.org> (raw)
In-Reply-To: <1e374d3c-ad4a-4379-a22b-85cbc083f658@tarantool.org>
Sergey,
On 18.11.23, Sergey Bronnikov via Tarantool-patches wrote:
> Hello, Max
>
> LGTM with a question below
>
>
> On 11/9/23 16:45, Maksim Kokryashkin wrote:
<snipped>
> >
> > +collectgarbage()
>
> Probably it is obvious, but I don't get it.
>
> Usually for forcing garbage collecting one need call `collectgarbage()` two
> times:
>
> for mark and sweep. You call it single time, why?
The reason of two consequent <collectgarbage> calls is not for "mark and
sweep" but rather for "full GC cycle + finalization of the resurrected
objects". The first call implements full (even 1.5) GC cycle; as a
result of this call some *objects* can be *released*, but the
corresponding *memory* is preserved in another list (gc->mmudata, IIRC)
to properly finalize the object (i.e. call __gc metamethod). Hence, the
second call finally releases the memory for the objects resurrected
within the sweep phase of the first call.
Since Max allocates plain FFI objects with no <ffi.gc> finalizers,
there is no need in the second <collectgarbage> call here.
>
<snipped>
> >
--
Best regards,
IM
next prev parent reply other threads:[~2023-11-20 14:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-09 13:45 Maksim Kokryashkin via Tarantool-patches
2023-11-13 6:58 ` Sergey Kaplun via Tarantool-patches
2023-11-18 16:52 ` Sergey Bronnikov via Tarantool-patches
2023-11-18 17:55 ` Sergey Bronnikov via Tarantool-patches
2023-11-19 11:49 ` Maxim Kokryashkin via Tarantool-patches
2023-11-20 14:53 ` Igor Munkin via Tarantool-patches [this message]
2023-11-22 15:28 ` Sergey Bronnikov via Tarantool-patches
2023-11-22 15:30 ` Sergey Bronnikov via Tarantool-patches
2023-11-23 6:32 ` Igor Munkin via Tarantool-patches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZVty4swlySaFUjr0@tarantool.org \
--to=tarantool-patches@dev.tarantool.org \
--cc=imun@tarantool.org \
--cc=max.kokryashkin@gmail.com \
--cc=sergeyb@tarantool.org \
--subject='Re: [Tarantool-patches] [PATCH luajit v2] test: fix flaky OOM error frame test' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox