Cuberite Forum
Questions about forgetful and chunk unloading. - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Cuberite (https://forum.cuberite.org/forum-4.html)
+--- Forum: Discussion (https://forum.cuberite.org/forum-5.html)
+--- Thread: Questions about forgetful and chunk unloading. (/thread-1189.html)



Questions about forgetful and chunk unloading. - tonibm19 - 07-24-2013

I saw in the wiki that there is an schema that doesn't save chunks, only reads, and I thought it could be usefull for a hunger games server (no need to regenerate chunks, only restart server). I have some questions.
- How often are chunks unloaded in MCServer?
- Would be use forgetful schema a performance boost? Would ram use be reduced?


RE: Questions about forgetful and chunk unloading. - bearbin - 07-24-2013

I don't think that RAM usage would be decreased by that much. There is some good info on the chunk unloading in a thread somewhere on here, but it isn't as optimised as it could be. You'll have to ask xoft or faketruth for the specifics.


RE: Questions about forgetful and chunk unloading. - xoft - 07-24-2013

Chunks are unloaded after they've been saved by the periodic save-all; i. e. every 5 minutes. Note that not all eligible chunks will be unloaded, because it may happen that a chunk is modified between the save and the unload attempt, in which case the chunk stays until the next save-all. This behavior is planned to be changed, chunks will be unloaded when they lose all clients (players) and they will be saved immediately before unloading.

I have no idea what Hunger games server does, so I'm not qualified to answer. However, I can at least present the facts I know: The forgetful schema really doesn't save, but that is the only "performance boost" that you get - the time needed to save a chunk; generally this is negligible. RAM use will be a little bit lower, but again, not because there's any difference in the chunk handling , but because the Anvil schema uses a memory cache for the most-recently accessed files' headers. This cache (about 8 KiB per MCA file) is about the only RAM reduction you'll get when using Forgetful instead of Anvil.

The primary intended use for the Forgetful schema is testing the storage schemas architecture when it was developed. The secondary effect, which *may* be useful at times, is that you can use this to "showcase" your builds. For this, you'd want to copy your normal world from the normal playing server to another server where the world is configured with "Forgetful" schema; then if a griefer griefs the world, the changes won't be saved and the world will be unchanged.

It might even be possible to configure a single server for this showcasing, using multiworld and some OS trickery, making the world storage for two worlds actually go into the same folder (hardlink?); then having the default (public) world set as Forgetful and the other (build) world set to Anvil, so you can go to the build world and build there and visitors will see the changes in the public world. This setup is, however, so much complicated that it's easier to just use the ProtectionAreas or another plugin.