Lua script memory limitations

Official support for: loomer.co.uk
Post Reply New Topic
RELATED
PRODUCTS

Post

I'm trying to generate pretty big lookup tables, and I get a memory error when I try to assign more than 256kb of data (> 32768 float elements in an array)

Trying to generate several tables works fine though.

Is there a limit to what a variable can hold in RAM ?

Post

I don't believe there is a (practical) limit, but I assume it's to do with how Lua internally allocates buffers for one large vs several smaller variables.

Your best bet is to increase the size of the memory pool that Lua can use in the properties, under Memory > Memory Allocated. The default is 1MB, which is plenty for most applications, but can be increased if need be. You can also keep an eye on the memory in the "Memory Used" field below it, which is periodically updated.

Note that the memory allocation is per module. Two Lua modules will each have their own private memory pool.
Architect, the modular MIDI toolkit, beta now available for macOS, Windows, and Linux.

Post

Oh I didn't notice the Memory tab :)

It seems to do the trick, thanks !

Post Reply

Return to “Loomer”