mojira.dev
MC-101232

Big tree generator causes memory leak

Note

The following is based on a decompiled version of Minecraft 1.9 using MCP 9.24 beta.

The bug

The method net.minecraft.world.gen.feature.WorldGenBigTree.generate(World, Random, BlockPos) sets the given world as value for the net.minecraft.world.gen.feature.WorldGenBigTree.world field. The problem is that after generating or not generating the tree the field is not set to null again. Because each biome has a WorldGenBigTree constant and the biomes are created once on startup of the game, a different world (or the title screen) which does not generate big trees has still a reference to the previously loaded world and prevents the garbage collection from collecting it.

Comments 2

Is this still an issue in the most recent versions (currently that is 1.10.2, or 16w43a) of Minecraft? If so, please update the affected versions and help us keeping this ticket updated from time to time. If you are the owner/reporter of this ticket, you can modify the affected version(s) yourself.

Should still be the case in 1.10, but I don't have a good map to test it right now

Marcono1234

(Unassigned)

Confirmed

bigtree, memory-leak, world

Minecraft 1.9.2, Minecraft 1.12.2

Minecraft 18w06a

Retrieved