PrismarineJS / prismarine-world

The core implementation of worlds for prismarine
http://prismarine.js.org/prismarine-world/
34 stars 32 forks source link

Unload chunks that haven't been needed for some time #20

Open rom1504 opened 8 years ago

rom1504 commented 8 years ago

it's now possible since we have chunk loading/unloading.

One way to do it would be using the timestamp stored in region files

rom1504 commented 4 years ago

https://en.wikipedia.org/wiki/Least_frequently_used

Karang commented 4 years ago

https://en.wikipedia.org/wiki/Cache_replacement_policies#LRU would be a better policy IMO

rom1504 commented 4 years ago

Yeah I was thinking about the case of a server where the spawn point might be unloaded with LRU if everyone disconnects and someone go explore somewhere far. But LFU has its own issues.

LRU seems like a simple policy that should work, especially if the cache is big enough (like 20x20 chunks)