mojira.dev
MC-236665

Memory leak in 21w37a

Overtime the game will use more and more memory causing chunks to not load, the game to freeze/crash and even make other programms crash because java will use up all your memory. this is called "memory leak"

Steps to Reproduce:

  1. open/close a singleplayer world or use a netherportal a couple times

  2. look at your overall memory usage, java will use more and more everytime

Observed Results:

chunks dont load,mobs dont move, projectiles dont fly,chat doesnt work, game and even other programms crash

Expected Results:

chunks load, mobs move, projectiles fly,chat works, game and other programms dont crash

 

Linked issues

Attachments

Comments

PR0CESS

Can confirm.
The memory leak is seriously bad compared to most memory leaks...

ampolive

I don't know if it's a memory leak per se, but Mem is going up and down significantly faster than in 1.17.1, and the game is also taking hundreds of megabytes of RAM more than said version. Some change in the world generation code is causing the garbage collector to go crazy.

Ceresjanin123

Can confirm, was loading and leaving worlds to verify MC-236650 and after leaving and joining for a few times my fps absolutely tanked and ram usage was at 2gb and would not go back down after waiting for 2 minutes

Earthcomputer

According to cortex, this is caused by the new jfr profiler support.

[media]
skyrising

Yeah, the issue is the event registered in MinecraftServer::registerJFRHooks which keeps a reference to this (the server) through the Runnable.
The fix would be to store the Runnable in a field and call FlightRecorder::removePeriodicEvent when the server shuts down.

migrated

Can confirm, I try to change it to a higher Memory but it resets it back to 2GB every time I close the game

migrated

billysjoberg

Community Consensus

Very Important

Performance

21w37a

21w38a

Retrieved