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
Go to the "Installations" section of your Minecraft launcher.
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]
Select the version you want to test.
Click on "More Options"
Change the "-Xmx" argument in the "JVM Arguments" section to allocate 6 GB of RAM or more. Example for 8 GB (recommended) :
-Xmx8G
Save your profile.
Open the task manager of your operating system.
Launch the game with the correct profile and observe the evolution of the RAM used by the game in the task manager.
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) :
Minecraft 1.13.2 (~2.1 GB) :
Minecraft 1.14.4 (~5.0 GB) :
Minecraft 1.15.2 (~5.2 GB) :
Minecraft 1.16 Pre-Release 2 (~5.2 GB) :
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
is duplicated by
relates to
Attachments
Comments


Affects pre release 4 1.16

Confirmed in 1.16 Pre-release 7.

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.

Can confirm for 20w27a

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]

@@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.

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

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.

@@unknown You are absolutely right.

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

Can confirm in 21w37a.

Can confirm in 21w41a.

Can confirm in 21w44a.

Can confirm in 1.18 Pre-release 1.

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

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

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.