lua-users home
lua-l archive

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


----- Original Message ----- From: "Shmuel Zeigerman"


Here is a pure-Lua test case that is very close to what my application is doing. (Change N if needed).
  local N = 6
  local tb = setmetatable ({}, { __mode="k" })
  print(collectgarbage"count")
  for n=1,N do
    for k=1,1e6 do tb[{}] = true end
    print(collectgarbage"count")
  end

--
Shmuel

Shmuel you worried me there, until Roberto posted. My embedded copy of Lua (with several patches and jit) was giving consistent low numbers (nothing over 200kB), but when I ran the program on the Lua standalone it increased rapidly to the hundreds of megs.

So I spent about an hour and a half trying to figure out what I'd changed that had modified the behaviour of weak keyed tables, whilst remaining puzzled at why the correct implementation allows the table to grow indefinitely. I've decided if Roberto can run it without problems, the bug is in the standalone and am leaving it at that. Still puzzled though.

- Alex