mojira.dev
MC-188163

Abnormally very high RAM usage since 1.13 (client side)

The bug

Since 1.13, the RAM used by the game has increased drastically to reach more than 5 GB in 1.15.2 and higher when Minecraft is not limited by JVM default arguments (= put -Xmx8G for example)!

For comparison, 1.12.2 uses only 500 MB of RAM!

This problem is apparently due to the DataFixerUpper introduced in 1.13.

How to test

  1. Go to the "Installations" section of your Minecraft launcher.

  2. Click on the three dots that appear when you hover over the profile you want to use for this test, and then click "Edit". If you don't already have a profile, create one!

    [media]
  1. Select the version you want to test.

  2. Click on "More Options"

  3. Change the "-Xmx" argument in the "JVM Arguments" section to allocate 6 GB of RAM or more. Example for 8 GB (recommended) : -Xmx8G

  4. Save your profile.

  5. Open the task manager of your operating system.

  6. Launch the game with the correct profile and observe the evolution of the RAM used by the game in the task manager.

  7. Repeat for each version you want to test.

    [media]

Videos tests

Here are all the tests I did from 1.12.2 to 1.16 Pre-Release 2, on all stable versions of Minecraft.

I have allocated 8 GB of RAM each time so as not to restrict the game to too low a ceiling, which would not allow us to see the problem.
No other programs run on the PC (except Discord and my recording program).
I did the test on my two different machines and the results are the same.

  • Minecraft 1.12.2 (~450 MB) :

[media]
  • Minecraft 1.13.2 (~2.1 GB) :

[media]
  • Minecraft 1.14.4 (~5.0 GB) :

[media]
  • Minecraft 1.15.2 (~5.2 GB) :

[media]
  • Minecraft 1.16 Pre-Release 2 (~5.2 GB) :

[media]

We can also observe that with each new version, the CPU is used harder and harder, even after the game is fully loaded (especially in 1.16).

Note: This ticket is attached to MC-190258 which processes the server side.

Related issues

Attachments

Comments

migrated
[media][media][media][media][media][media][media]
migrated

Affects pre release 4 1.16

 

migrated

Confirmed in 1.16 Pre-release 7.

marcono1234

It appears this is related to DataFixerUpper, which was introduced for 1.13. This would explain why this issue started occurring for 1.13. This applies to the dedicated server (MC-190258) as well.
I don't have enough experience in profiling Java applications, but it appears DataFixerUpper creates multiple hundred Mega Bytes of objects which it then discards.

Note that this apparently only affects start up of the game / server. Afterwards the the data is garbage and will be collected by the JVM garbage collector if necessary.

migrated

Can confirm for 20w27a

migrated

Can confirm in 1.16.2 RC-1, This happens not only at the start of the game, but also when during gameplay. I also noticed that after the game is launched, the process remains "MinecraftLauncher.exe", which if disabled, the game will be as if nothing had happened, but the process "MinecraftLauncher.exe" it remains to consume memory.

[media]

marcono1234

@@unknown, if you are experiencing this issue with MinecraftLauncher.exe, please create a separate report for the launcher project (MCL) (after having searched for existing reports) and remove your attachment from this report. This project (MC) and this report are only about the game itself but not the launcher.

migrated

1.17.1 still have this issue. In fact, it got worse.

ampolive

If this issue stems from the datafixers, it seems logical that this will progressively worsen, as each snapshot or release introduces a new data version.

ZeNico13

@@unknown You are absolutely right.

syarumi

There's also MC-202953 on the maxed CPU usage side of things due to DFU.

ampolive

Can confirm in 21w37a.

ampolive

Can confirm in 21w41a.

ampolive

Can confirm in 21w44a.

ampolive

Can confirm in 1.18 Pre-release 1.

migrated

Can confirm in 1.19, per the reason stated previously, it get even worse. Some even stated to have caused the PC to thermal shutdown as seen at MC-202953

santinocavazos

That's caused by a phenomenon in 1.13 called The Flattening.

ouroya

I have had this issue happen so severely that my computer shuts down within minutes or seconds of launching the game, though an entire shutdown is rare and usually this just causes the computer to freeze or massively slow down. My suggestion is to make the DFU lazily loaded, so it is not always active.

ZeNico13

(Unassigned)

Confirmed

Normal

Performance

client, high, high-ram, memory-leak, ram, ram-usage

1.15.2, 1.16 Pre-release 2, 1.16 Pre-release 3, 1.16 Pre-release 4, 1.16 Pre-release 6, ..., 1.19.1 Pre-release 4, 1.19.2, 22w45a, 1.19.3, 23w07a

1.19.4 Pre-release 1

Retrieved