[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: GC and userdata objects
- From: Roberto Ierusalimschy <roberto@...>
- Date: Wed, 11 Apr 2018 18:45:42 -0300
Maybe there is a misunderstanding of how the GC works. What moves the GC
is not the amount of memory being used, but the amount of memory being
allocated. If you are using 100GB, frees them all, and do not allocate
anything else, the GC will not collect anything.
So, keeping some huge userdata is not particularly relevant to the
GC. What is relevant is the allocation of a huge userdata. You can
communicate this to the GC by calling collectgarbage("step", x) with 'x'
proportional to the size of the userdata.