mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-22 11:03:12 +00:00
18 lines
349 B
Lua
18 lines
349 B
Lua
local skynet = require "skynet"
|
|
|
|
-- set sandbox memory limit to 1M, must set here (at start, out of skynet.start)
|
|
skynet.memlimit(1 * 1024 * 1024)
|
|
|
|
skynet.start(function()
|
|
local a = {}
|
|
local limit
|
|
local ok, err = pcall(function()
|
|
for i=1, 1000000 do
|
|
limit = i
|
|
table.insert(a, {})
|
|
end
|
|
end)
|
|
skynet.error(limit, err)
|
|
skynet.exit()
|
|
end)
|