Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-202246

Drowned navigation causes memory leak/performance degredation

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: 1.16.3, 1.16.4 Pre-release 1
    • Fix Version/s: 20w45a
    • Confirmation Status:
      Community Consensus
    • Category:
      Performance
    • Mojang Priority:
      Important

      Description

      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.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            skyrising skyrising (Simon Wanner)
            Votes:
            19 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              CHK: