Re: lua traceback during memory allocations

  • From: Benn Bollay <benn@xxxxxxxxxxxxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Fri, 14 Mar 2014 18:39:28 -0700

On Fri, Mar 14, 2014 at 4:22 PM, Yichun Zhang (agentzh)
<agentzh@xxxxxxxxx>wrote:

> Hello!
>
> On Fri, Mar 14, 2014 at 12:57 PM, Greg Greenway wrote:
> > I'm trying to add some tracking of lua allocations to help figure out
> where
> > I'm "leaking" memory in my code.  (It's not technically a leak in the
> strict
> > sense because something is referencing it).
> >
>
> I think the lj-gc-objs tool based on systemtap can help analyzing such
> leaked Lua GC objects:
>
>     https://github.com/agentzh/stapxx#lj-gc-objs
>
> Just look at the type of GC objects with largest size, or the count.
> And we can trace further based on the findings.
>

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']"?

Other related posts: