Cuberite Forum
Smart chunk management - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Cuberite (https://forum.cuberite.org/forum-4.html)
+--- Forum: Development (https://forum.cuberite.org/forum-13.html)
+--- Thread: Smart chunk management (/thread-2428.html)

Pages: 1 2


RE: Smart chunk management - Schwertspize - 04-26-2016

"The used RAM is static. This means that even when there are few players online, the server would be consuming the same amount of RAM as always." 

I think this isnt bad, because "unused ram is wasted ram" and is only significant if you run multiple servers on one machine and need some kind of load balancer. What do you think about a plugin interface for that? So a plugin can hook in the process of deciding whether to free ran or use more ram and decide eg also based on other data cuberite cannot access (like load on other instances or something, if someone programs that)


Plugins - LogicParrot - 04-26-2016

This isn't bad at all for dedicated servers. It's bad for a server that is sharing resources with other applications, e.g. a desktop PC.

A plugin interface for changing maxRam would be very easy to implement.


RE: Smart chunk management - worktycho - 04-27-2016

Would a plugin API be useful? When is someone going to run more than one instance of cuberite on the same machine? The only thing which has the information necessary to decide how much RAM we can use is the OS memory allocation subsystem. And that is not exposed at all.


RE: Smart chunk management - Seyaku - 05-26-2016

Maybe save the time each chunk was last active. Then the delta (D) between last active time and current time is compared to threshold (T). T should be low (10-30 sec) for chunks not neighboring active chunks and high (120-300 sec) for chunks neighboring active chunk. (it stands to reason chunks neighboring active chunks are more likely to be visited more often.)

When D > T unload, if chunk is "dirty" save and then unload. (so don't distinguish between clean and dirty chunks)

This could ofc be combined with the max ram strategy.