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

Memory exhaustion when handling snowy terrain from pre-1.18 worlds.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • None
    • 1.18 Pre-release 1, 1.18 Pre-release 2
    • None
    • Gentoo Linux, Java Version 11, AMD Radeon RX 5600 OEM
    • Unconfirmed
    • (Unassigned)

      I've been noticing some performance issues when moving around in a world last run in 1.17, which seems to kick in with old, snow-covered terrain. The game consumes more and more memory until the game regularly bumps into the 2 GiB limit, causing intermittent (but frequent) freezes. Here's what I've been able to figure:

      • The issue does not kick in with old terrain not covered in snow (that is, wandering around grassy areas seems to have no effect).
      • Last week's snapshot didn't seem to have this issue when I tested the same old level, and went to my base in the snow (though I may not have played long enough for the memory to be eaten).
      • Saving & quitting when RAM usage is high, then restarting Minecraft and loading the level back in, does not immediately chew into the RAM again, hinting at the problem being some kind of memory leak (as opposed to some operation being naturally memory-intensive).
      • There is no issue wandering around snowy areas in a brand-new, fully 1.18 world, not even in amplified worlds. This only came up when walking around in a pre-1.18 world. For fully new worlds, the memory stays between 800 and 1500 MiB, regardless of how long I play.

      It seems to me that something about how old chunks are upgraded is causing the issue, with new caves underneath being the likely culprit (biome blending might be a contributing factor; I have no way of knowing for certain when I'm surrounded by 1.17 chunks vs. when I'm asking the game to build new ones and blend them into old ones).

      The compressed JFR recording 1.18_pre1_default_1.17_world.jfr.xz represents a fresh copy of my 1.17 world, where I last left off in a grassy plains area. With the help of a zoom level 4/4 map, I made my way to my base in the snowy plains. The following interesting timestamps are to help in looking at the data in the recording (I don't know if JFR preserves timezone info, so I'm presenting them as a simple number of seconds since the epoch):

      • At 1636720284 is when I set foot in the snowy plains. A bit before this time I took a detour through a hole in my map that hinted at having some slightly snowy windswept hills. That detour resulted in the memory usage floor going up from around 800 to 900 MiB, but with the ceiling still at 1500 MiB. After this time, both the floor and ceiling started to rise the more time I spent in the snow.
      • At 1636720596 the stuttering got to the point where I knew it would never escape the cycle of freezes, and from that point on to the end of the recording I did not move at all in the game world. This is to show that the problem, at a point, isn't simply that I keep asking the game to process more old chunks.

      The reason why I'm at all confident the snow is (somehow) the issue is that I spent another test walking along (as best as I could tell) the border between 1.17 and 1.18 in a large stretch of non-snowy terrain, and went longer than the JFR recording above without noticeable gameplay issues. The snow itself may not be the issue, but it seems to be a good predictor of when the game starts eating up memory.

      I was unable to compress my JFR recording of a fully-1.18 Default world enough to upload, so I've provided comparison screenshots of the Used Heap graph in JMC between a fully 1.18 world and the JFR I could upload.

            Unassigned Unassigned
            ShimmerFairy Faye N
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: