lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Here's an even weirder case:.

Put following trivial input code:

    for i=0,40000000 do pos(i,3,i) end

into a file called "bench.lua", and use it like:

    ./snogray bench.lua /tmp/out0.tga

Each call to "pos" will allocate a small userdata object, which is not
referenced by anything -- pure garbage!

With Lua 5.1.4 or LuaJIT, this takes about 30s, but only uses 4-5MB of
memory.

However with Lua 5.2.0, it uses about 3.4 _GB_ (and the system starts
thrashing).  Something's definitely weird here...

According to valgrind (with a smaller loop count), there are no memory
leaks in either case.

Thanks,

-Miles

-- 
Education, n. That which discloses to the wise and disguises from the foolish
their lack of understanding.