[luci] Lua memory usage

Conor O'Gorman i at conorogorman.net
Wed Nov 28 19:24:13 CET 2012


On Wed, 2012-11-28 at 15:21 +0100, Jo-Philipp Wich wrote:

> That code is there to preserve the original environment of the
> referenced functions, e.g. if they want to access stuff declared in
> the module they're originating from.
> 
> I think the change above would break at least
> http://luci.subsignal.org/trac/browser/luci/trunk/applications/luci-commands/luasrc/controller/commands.lua#L168
> - maybe you can test it, I believe it will fail to find the local
> parse_cmdline() function.
> 
> Not sure how to fix that properly, maybe by moving the metatable
> binding inside the call() function somehow.
> 

Excellent. Thank you for that info, I will look at that example. This is
the type of thing I was concerned about. But didn't know enough.

> > But, there was still a leak, visible in the uclibc heap, not the
> > lua memory report. Playing with the uclibc malloc_trim, and also
> > restarting the lua interpreter did not help. I have resorted to
> > re-starting the uhttpd process.
> 
> The leak could happen inside lmo.so or parser.so, maybe take a closer
> look there.

Again, very useful. I shall examine. I had assumed that lua libs would
just affect the lua heap, but it's worth a check as I had forgotten
about those libraries.

> ~ Jow

Thanks,
Conor




More information about the luci mailing list