Version: 1.4
new: 2nd status with settings at start, 2 more var to remember highest/lowest lua memory / setting for loop-time
last update: 31.03.2019
no dependencies
tested on mts 5.0.0, but there is nothing used, should also run under 0.4.x
Licence: LGPL v3.0
Download / Source at: https://github.com/Minetest-One/free_lj_mem
What does it:
* automatic collectgarbage() every x time (default set to 3600 = 1 hours)
* depend on minetest.conf debug_log_level (warning, action, info) reports on reduce memory usage, until warning message to admin as of name, or minetest.log
* depend on minetest.conf debug_log_level (warning, action, info) print to log / terminal / player when a lua maximal memory (value to set) is reached even after a collectgarbage().
- report that actual memory usage is higher than set max memory
- setting of maximum lua memory depends on lua 2 GB or luajit 1 GB and also on other unknown facts
- set maxluamem can start with max of lua 2048000 or 1024000 , and after got an OOM should be set about 10% lower, so admin might get aware, OOM getting close
* detect kind and version of used lua / luajit, and post report at loading
* give status at loading depend on minetest.conf debug_log_level that loaded (+ amount of memory is used after this have been loaded)
start on test-server (5.0.0)
- Code: Select all
[Mod] free_lj_mem detected: LuaJIT 2.1.0-beta3
[Mod] free_lj_mem settings: 60 sec / warn: 2000 KB
[Mod] free_lj_mem (1.40 31.03.2019) - loaded - end mem : 1016 KB
start on main server (5.0.0)
- Code: Select all
free_lj_mem detected LuaJIT 2.0.5
[Mod] free_lj_mem settings: 1800 sec / warn: 150000 KB
[Mod] free_lj_mem (1.4 - 31.03.2019) - loaded - end mem : 56413 KB
and test when running, depends on destination
- Code: Select all
[MOD] free_lj_mem: cleaned 2157 to 2088 (max: 2590 / min: 2088) KB
- Code: Select all
2019-03-29 06:31:50: ACTION[Server]: [MOD] free_lj_mem detected luamem warning: 10490 > 10000 !! - near OOM
- Code: Select all
[MOD] free_lj_mem warning: 2088 actual more memory used then set max: 2000 KB ! possible OOM
... this is my first mod, report issues here
* as this should sole the problems we faced yet with [urlhttps://forum.minetest.net/viewtopic.php?f=6&t=21934]OOM[/url]
* the advantage to [Mod] stop_lj_oom is less lag, even report and/or warnings on several channels (I think I will fork that mod also, just make is less time check memory, as it does now)