FYI,

Zone Manager churns up gigabytes of heap per day on my server. Looked into it, and it turns out to be almost entirely due to `OnEntitySpawned()`.

Nivex provided this fixed version that reduces memory churn by 95%:

private void OnEntitySpawned(BaseEntity entity) { entity?.Invoke(() => CanSpawn(entity), 2); }​

It looks like the 2 major differences are:
  • Hook takes parameter of desired type, instead of taking more generic type and then casting twice.
  • Uses behavior API `Invoke()` instead of creating one-shot timers and dropping them on the floor (this is probably where the real savings comes in?).

Side note: I think some of us are using Zone Manager purely to facilitate PVE exclusion zones. It might be a huge improvement to us if the code were to skip some processing when there aren't any zones with flags set etc.