Bukkit/CraftBukkit — comment on commit 19e3eff96a8404fba6e88c147d15d4ad4be1a7f5
File:  line 0
By Raphfrk:

I wrote it. I just wanted to make sure that it didn't unload edge case chunks, and there is quite a bit of overkill.

With variable view distances, it would have to check that too. The code scans all online players, so isn't massively efficient.

Each chunk has a list of players who are viewing the chunk, so if it was being updated, one improvement would be to check if that list was empty.