Drowned navigation causes memory leak/performance degredation
When a drowned entity is loaded the default navigation (the one created by Mob::createNavigation) is added to ServerLevel::navigations because Drowned::updateSwimming was not executed yet.
But when it's unloaded the one returned by Mob::getNavigation() is removed from ServerLevel::navigations, which by that point is either Drowned::waterNavigation or Drowned::groundNavigation.
This causes a memory leak because the navigation added to the Set is not one of those two and thus not ever removed. As a result Level::setBlock performance degrades.
For reference our server accumulated approximately 8,100 navigations in the Set with only 38 drowned actually being alive in approximately 26h.
2020-10-17, 01:52 AM
2021-04-27, 04:20 PM
2020-10-23, 05:08 PM
19
7