FlashAirのLua環境で使用できるメモリ容量を,おおざっぱに調査します.
読み込んでいるライブラリや,設定,ファームウェアバージョンなどによっても
変動すると思われます.
調査にはそれなりの時間がかるため,実行の際はお茶でも飲んでお待ち下さい.
LUA : not enough memoryを意図的に発生させて調査しているため,
LUA : not enough memoryが大量に出ても驚かないでください.
また,Flash上に大量に書き込むため,Flashの寿命を気にされる方は利用しないことをおすすめします.
読み込んでいるライブラリや,設定,ファームウェアバージョンなどによっても
変動すると思われます.
調査にはそれなりの時間がかるため,実行の際はお茶でも飲んでお待ち下さい.
LUA : not enough memoryを意図的に発生させて調査しているため,
LUA : not enough memoryが大量に出ても驚かないでください.
また,Flash上に大量に書き込むため,Flashの寿命を気にされる方は利用しないことをおすすめします.
print "HTTP/1.1 200 OK" print "" opn = io.open ld = "load" tb={} f = opn(ld, "w") f:close() function t() while true do f = opn(ld, "a") f:write("@@@@@@@@@@") --W04は@を100個にすること f:close() collectgarbage() f = opn(ld, "r") buf = f:read("*a") f:close() collectgarbage() buf="" collectgarbage() end end function m() c=0 buf="" collectgarbage() while true do table.insert(tb,"*") c=c+1 collectgarbage() end end local f, r = pcall(t) if not f then print(r) end local f, r = pcall(m) if not f then print(r) end print("fread:"..lfs.attributes(ld,"size").." Byte") print("table:"..c.." elements")
コメントをかく