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

Chunk generation causes memory leak

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.19 Pre-release 3, 1.20.4
    • JVM arguments: "-Xmx2G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M"

      Windows 10, bundled Java runtime.
    • Plausible
    • Performance
    • Normal
    • Platform

      When generating chunks, the server can occasionally get overloaded and new chunks can take many seconds to generate. This appears to happen more severely when the game has been running for a while.

      I generated the chunks using a redstone mechanism (attached as g19.nbt). The redstone mechanism teleports the player around the map in a grid pattern spaced 192 blocks apart, teleporting the player about once every 13 seconds.

      After a while, the server started spamming the chat with "overloaded" messages. They happened occasionally at first, with small numbers around a few seconds, but gradually got more frequent with longer pause times.

      09:56:01.367 Can't keep up! Is the server overloaded? Running 3688ms or 73 ticks behind
      09:59:10.343 Can't keep up! Is the server overloaded? Running 3365ms or 67 ticks behind
      10:12:36.215 Can't keep up! Is the server overloaded? Running 5886ms or 117 ticks behind
      11:19:57.706 Can't keep up! Is the server overloaded? Running 2377ms or 47 ticks behind
      11:22:52.019 Can't keep up! Is the server overloaded? Running 2390ms or 47 ticks behind
      11:29:24.384 Can't keep up! Is the server overloaded? Running 2155ms or 43 ticks behind
      11:30:09.836 Can't keep up! Is the server overloaded? Running 8156ms or 163 ticks behind
      11:30:38.273 Can't keep up! Is the server overloaded? Running 3444ms or 68 ticks behind
      11:31:25.252 Can't keep up! Is the server overloaded? Running 9523ms or 190 ticks behind
      11:32:27.124 Can't keep up! Is the server overloaded? Running 24395ms or 487 ticks behind
      11:35:23.968 Can't keep up! Is the server overloaded? Running 51889ms or 1037 ticks behind
      11:36:50.947 Can't keep up! Is the server overloaded? Running 49518ms or 990 ticks behind
      11:38:46.258 Can't keep up! Is the server overloaded? Running 77829ms or 1556 ticks behind
      11:39:55.496 Can't keep up! Is the server overloaded? Running 44267ms or 885 ticks behind
      11:42:15.089 Can't keep up! Is the server overloaded? Running 39609ms or 792 ticks behind
      11:43:45.484 Can't keep up! Is the server overloaded? Running 52905ms or 1058 ticks behind
      11:45:11.470 Can't keep up! Is the server overloaded? Running 48491ms or 969 ticks behind
      11:50:05.431 Can't keep up! Is the server overloaded? Running 31503ms or 630 ticks behind
      11:52:28.747 Can't keep up! Is the server overloaded? Running 43318ms or 866 ticks behind
      11:53:56.848 Can't keep up! Is the server overloaded? Running 50619ms or 1012 ticks behind
      11:55:10.338 Can't keep up! Is the server overloaded? Running 48509ms or 970 ticks behind
      11:56:59.778 Can't keep up! Is the server overloaded? Running 71949ms or 1438 ticks behind
      11:59:17.658 Can't keep up! Is the server overloaded? Running 100429ms or 2008 ticks behind
      12:01:06.817 Can't keep up! Is the server overloaded? Running 84187ms or 1683 ticks behind

      The chunk generation ended successfully shortly thereafter (by reaching the end of the grid) but it was very slow towards the end.

      I quit the world at this point. Saving the world took about 100 seconds with the disk pegged at close to 100% the whole time.

      To reproduce:
      1. Create a fresh world in creative mode.
      2. Copy the structure file "g19.nbt" into "/generated/minecraft/structures" in the world save.
      3. Use a structure block to place the mechanism "g19" in the spawn chunks.
      4. Start the mechanism.
      5. Let the game run unattended for up to 25 hours.

      Attachments:
      g19.nbt - place this structure in the spawn chunks using a structure block

            Unassigned Unassigned
            bdm68 bdm68
            Votes:
            12 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              CHK: