2

good day i'm a newibe to tarantool and i hava question about memory limit for client application inside tarantool i have in-memory database for 300 millions items and lua application that select part of them, after select i wrap result to 'class' for simpler interaction from code. For example:

Foo = {}
Foo.__index = Foo

function Foo.create(rawData)
    local self = setmetatable({}, Foo)

    self.PrimaryId = rawData[1]
    self.BarId     = rawData[2]

    local fields = rawData[3]
    self.Name    = fields[1]
    self.Date    = fields[2]

    return self
end

and usage:

local data = box.space.Foo.index.barId:select({barId})
local ctor = Foo.create
local foo = {}

for i = 1, #data do
    table.insert(foo, ctor(data[i]))
end

on first run in most cases it run successful, but on second it with 100% probability fails with message (tarantool message):

PANIC: unprotected error in call to Lua API (not enough memory)

i'm understand, that there is problems with memory usage (non released memory), but i have question about limit - is there some limit to lua application? because i see in monitor for memory consumption and note that there are enough free memory and fail appeared after application start using more then 1.2 Gb

anatoly.kryzhanosky
  • 185
  • 1
  • 1
  • 18

1 Answers1

3

Tarantool uses luajit, that means that the limitation came from luajit [1].

Also, luajit (like lua) has an issue with a garbage collector[2], sometimes you have to call it manually[3] or you will have "OOM panic".

[1] Links:

[2] http://wiki.luajit.org/New-Garbage-Collector

[3] http://luatut.com/collectgarbage.html