lua-resty-string icon indicating copy to clipboard operation
lua-resty-string copied to clipboard

the limit of luajit table ??

Open lingbl opened this issue 5 years ago • 2 comments

249577944 items is not very big at my In my opinion,but luajit just overflow , so whats the limit ?? Can be overcome ??

tb = table.new(249577944,0) table overflow stack traceback: [C]: in function 'new' stdin:1: in main chunk [C]: at 0x004051e0

tb = {} for i = 1, 449577944 do

tb[i] = "abcd"..i end PANIC: unprotected error in call to Lua API (stdin:2: table overflow stack traceback: stdin:2: in main chunk [C]: at 0x004051e0)

lingbl avatar Apr 22 '20 17:04 lingbl

@lingbl There is a hard-coded table size limit for the hash part, which is 2^26. What's your use case for allocating such a huge lua table? Maybe you can use LuaJIT's FFI cdata or OpenResty lua_shared_dict for it instead.

agentzh avatar Apr 22 '20 19:04 agentzh

thankyou , my question is not smart , I load fastq file, it is allways very big.
By the way , why lua have to mix array and hash , as the table.insert is not fast enough.我知这不是你们的问题, 我就是想吐槽一下

lingbl avatar Apr 23 '20 03:04 lingbl