"not enough memory", but there is memory
Posted: Wed Jul 22, 2015 10:03 am
I am fighting with a simple program and i've reduced it to a following method
local buf ={}
function memTest(size)
tmr.stop(3);
tmr.alarm(3, 50, 1, function()
table.insert(buf,"12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890")
collectgarbage()
print(node.heap())
end)
end
which fails with "not enogh memory" while node.heap() says 13000.
I started with a more complex program, that used network and so on, but it used to restart even on statements like print("a"..20), and i decided the problem may be that the amount of free memory was ~5000 bytes.
Now with the simpler proogram if fails even sooner
Any idea what i may be missing?
local buf ={}
function memTest(size)
tmr.stop(3);
tmr.alarm(3, 50, 1, function()
table.insert(buf,"12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890")
collectgarbage()
print(node.heap())
end)
end
which fails with "not enogh memory" while node.heap() says 13000.
I started with a more complex program, that used network and so on, but it used to restart even on statements like print("a"..20), and i decided the problem may be that the amount of free memory was ~5000 bytes.
Now with the simpler proogram if fails even sooner
Any idea what i may be missing?