Lua Processing Limits

All discussions & material related to Command's Lua interface

Moderators: angster, RoryAndersonCDT, michaelm75au, MOD_Command

Post Reply
jkgarner
Posts: 175
Joined: Thu Apr 30, 2020 12:42 pm

Lua Processing Limits

Post by jkgarner »

This is along the same vein as my previous post asking about event processing limits, however, I wished this to be a separate discussion.

As I build up my Lua Library (see:
https://www.matrixgames.com/forums/tm.a ... y&#4831042 ) I begin to wonder how much memory Lua has to execute, and at what point loading in the library will start to impact what I can do within Lua.

Has anybody any ideas?



KnightHawk75
Posts: 1850
Joined: Thu Nov 15, 2018 7:24 pm

RE: Lua Processing Limits

Post by KnightHawk75 »

I don't know what the "limit" is or if there even is one exactly (beyond of course the address space of the host process).
Have you actually run into any situation where this has become an issue?

I've used like 90mb (temporarily) in the past without issue while testing with some very large tables in fairly large scenes. Generally though in my routines when I'm doing a ton of data work that I know is generating garbage (found during testing) I'll make my own calls to force Lua garbage collection via collectgarbage("collect") when said routine is completed or after scavenging large amounts of data or rebuilding large tables. I never noticed much a cost of doing the collection...so long as it's not happening every second or two.

I have a large library as well and even when loading it in "in full" (ie I loading in namespaces I don't actually need) it's still < ~1mb overhead last I looked, I think the largest sort of on-going average I've noticed in things I've done involving a chunky amount of on-going data in various tables was on the order of only taking ~15mb of memory. Your mileage may vary though with professional edition where you have access to .io and I presume full use of external lua modules and libs etc where you may be doing far more than those of us with the game-edition.

I do wish some sort of pre-load or unload sort of thing existed so I could fully cleanup after myself for the next guy's mapload without a restart though. https://www.matrixgames.com/forums/tm.asp?m=4907386
Post Reply

Return to “Lua Legion”