Reputation: 120
This might be sort of a strange question, but curiosity got the best of me when I ended up getting a memory error after filling up a table with 14 million+ items.
Is there a sort-of set memory limit for Lua tables, or is it somewhat dynamic at all? I figured Lua itself would allocate so much memory in general, and the error would be thrown when that ran out, but that's just a wild guess. Anyone know for sure? Thanks.
Upvotes: 5
Views: 7543
Reputation: 3660
t={}
for i=1,176000000 do t[#t+1]=i end
Tried out with a lua windows 64 bit binary - works fine.
A 64 bit luajit binary crashed. Seems like a bug of luajit.
Upvotes: 7