Re: Garbage collection test case

  • From: Mike Pall <mike-1503@xxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Sun, 29 Mar 2015 12:46:20 +0200

Shmuel Zeigerman wrote:
> Here is a test case where LuaJIT 2.x (with JIT turned on) seems to fail
> to collect garbage.

The JIT-compiled traces specialize to closures, which in turn keep
their upvalues anchored. E.g. save_table and the inner closure in
SaveToString. Run jit.flush() once before collectgarbage() to check
this is the case. To avoid this, rewrite the code without using
transient closures.

--Mike

Other related posts: