Light-Cleaner
Light-Cleaner copied to clipboard
How is minFreeMemory calculated?
In the config, minFreeMemory is set to 400, in megabytes I presume. My server has 7.8GB of ram free, which have been allocated to the server. So am I understanding minFreeMemory wrong or is there something else to it?
(Sorry for late reply)
MinFreeMemory is the amount of remaining available memory that is permitted until light cleaner pauses, waiting for memory to be freed. It does some maintenance in the background to make sure this happens, like saving pending data to disk.
Read it as "minimum available (free) memory"
If you have a very large server, memory can fluctuate a whole lot more. Then it can happen that while light cleaner is starting a task when 500mb of memory is remaining, during the runtime of the task the server rapidly allocates 600 mb, causing the entire server to effectively crash. You will want to raise the minFreeMemory if you have a very large amount of memory usage fluctuations / a lot of players online that can cause usage spikes when chunks are loaded when they spawn,
Basically, you will want to prevent light cleaner from running when available memory reaches critical levels. What is critical will depend on the behavior of the server.
In the past I made the default for this 200MB and this proved to be far too low, even though it worked fine on my (one player-online that is not moving) test server. 400MB works for more people, I didn't want to make it higher because some servers run on 1GB of RAM. It's complicated.