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

OutOfMemory crash upon attempting to save a world with very large amounts of block entities

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.17.1, 21w37a, 21w38a, 21w39a, 21w40a, 21w41a, 21w42a, 21w43a, 21w44a, 1.18 Pre-release 1, 1.18 Pre-release 4, 1.18 Pre-release 5, 1.18 Release Candidate 3, 1.18, 1.18.1, 22w05a, 22w15a, 1.19 Pre-release 1, 1.19, 1.19.1 Pre-release 4, 1.19.2, 23w04a, 1.20.4
    • Confirmed
    • Crash, Performance
    • Important
    • Platform

      The bug

      Very large amounts of block entities (in this case, furnaces) cause intense server-side lag (MC-117075) and use up excessive memory. This will cause the world or certain chunks to fail to save or corrupt, and the game to run out of memory and crash. This does not happen on superflat worlds with furnaces.

      To reproduce

      1. Create a new world and switch to spectator mode.
      2. Execute /fill ~50 ~ ~50 ~-50 ~2 ~-50 furnace and create multiple layers of tens of thousands of furnaces in the world.
      3. Continue to execute the commands up to y=255 until about a million furnaces are placed.
      4. Notice how extreme lag occurs, and observe the Mem usage steadily going up.
      5. Quit the world.
      6. The world will get stuck in the saving world screen, until failing to save and crashing due to java.lang.OutOfMemoryError: Java heap space.

        1. 2021-10-31-1.log
          20 kB
          [Mod] ampolive
        2. 2021-11-09_21.58.07.png
          60 kB
          [Mod] ampolive
        3. crash-2021-09-24_22.31.29-server.txt
          4 kB
          [Mod] ampolive
        4. crash-2021-10-04_19.57.02-client.txt
          4 kB
          [Mod] ampolive
        5. crash-2021-11-27_22.33.07-client.txt
          5 kB
          [Mod] ampolive
        6. crash-2021-12-19_20.33.54-server.txt
          2 kB
          [Mod] ampolive
        7. deobf_crash-2021-09-24_22.31.29-server.txt
          6 kB
          [Bot] Arisa
        8. deobf_crash-2021-11-27_22.33.07-client.txt
          9 kB
          [Bot] Arisa
        9. deobf_crash-2021-12-19_20.33.54-server.txt
          4 kB
          [Bot] Arisa
        10. error_log_(abridged).txt
          3 kB
          [Mod] ampolive
        11. latest_2.log
          27 kB
          [Mod] ampolive
        12. latest.log
          41 kB
          [Mod] ampolive
        13. latest-1.log
          24 kB
          [Mod] ampolive
        14. latest-2.log
          15 kB
          [Mod] ampolive

            Unassigned Unassigned
            ampolive [Mod] ampolive
            Votes:
            20 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              CHK: