Re: lua traceback during memory allocations

  • From: "Yichun Zhang (agentzh)" <agentzh@xxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Sat, 15 Mar 2014 14:54:32 -0700

Hello!

On Fri, Mar 14, 2014 at 6:39 PM, Benn Bollay wrote:
> Once you identify the piece of memory that's lingering, are there any tools
> available for determining why the GC decides not to collect it?  Something
> that could indicate where the reference is being held, for example, by
> returning something like "_G_['foo']['bar']['bah']"?

My lj-gc-objs tool essentially walks through all the GC objects in the
same way as the "sweep" phase of the GC cycle.

To get the reference route from the GC roots to a particular GC object
you're interested in, you can just create another stap (or gdb) tool
that walks through all the live GC objects from the GC roots in the
same way as the "mark" phase of the GC cycle ;)

LuaJIT GC's data structures already contain all the information we need anyway.

Best regards,
-agentzh

Other related posts: