Use of the loadChunk() method

Discussion in 'Plugin Development' started by Raphfrk, Feb 5, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    Raphfrk

    I was having a look at the chunk management system for the server and it looks like the unload algorithm is purely based on player movement.

    There is a 21x21 box of square of chunks (so 336x336 blocks) that is roughly centred on the player. As the player moves, any blocks that move outside that square are removed.

    This means that a loaded chunk that is far away from any players will never unload, since it will never move from inside to outside any players square.

    One option would be to do it like the JVM does and do (incremental) "garbage" collection. If a chunk hasn't been checked in a while and/or if the number of chunks in memory is greater than twice the theory (21x21x(number of players)), then it scans for chunks that are far away from any players.

    I have a feature in Server Port called "circle load". This basically loads all chunks within a distance of the admin who uses it. It causes a server crash to due to loading to many chunks (at least that is what I think is causing it :)).
     
Thread Status:
Not open for further replies.

Share This Page