HomeJavaModsDimension Leak Fix
Dimension Leak Fix
ModsJava

Dimension Leak Fix

by Bahanos · on CurseForge

Fixes memory leaks when switching dimensions. Mods like Collective, AmbientSounds and Create retain old worlds in RAM - this mod cleans them up…

Which Minecraft do you have?

Every version of the game needs its own build. Pick yours, then download — the wrong build installs fine and then does nothing in the game. This mod is built for Fabric only.

⬇ Download for 1.21.11⬇ Download for 1.21.10⬇ Download for 1.21.9⬇ Download for 1.21.8⬇ Download for 1.21.7⬇ Download for 1.21.6⬇ Download for 1.21.5⬇ Download for 1.21.4⬇ Download for 1.21.3⬇ Download for 1.21.2⬇ Download for 1.21.1⬇ Download for 1.21⬇ Download for 1.20.6⬇ Download for 1.20.5⬇ Download for 1.20.4⬇ Download for 1.20.3⬇ Download for 1.20.2⬇ Download for 1.20.1⬇ Download for 1.20⬇ Download for 1.19.4⬇ Download for 1.19.3⬇ Download for 1.19.2⬇ Download for 1.19.1⬇ Download for 1.19⬇ Download for 1.18.2
I don't know my version or loader
Open the Minecraft launcher and look at the profile you play on — it names both, like fabric-loader-1.21.4. The version also shows in the bottom-right corner of the game's main menu.
No loader in the profile name? Then it's plain Minecraft, and these mods won't run — you need Fabric or NeoForge installed first.

Every time you travel between the Overworld, Nether, and End, your client creates a new ClientWorld. The old world should be garbage-collected, but several popular mods accidentally hold references to it - causing it to stay in memory forever.

After just a few dimension changes, this can eat 4-8 GB of RAM, leading to lag spikes, stuttering, and eventually crashes.

Dimension Leak Fix automatically detects dimension transitions and surgically breaks these retention chains, recovering 2-4 GB of memory per transition.

What it fixes

Source Problem Impact
Entity references Entities in the old world hold a .level field pointing back to it ~200 MB per transition
Collective BlockEntityData.cachedBlockEntities retains old worlds through nested WeakHashMaps ~1.2 GB per transition
AmbientSounds AirPocketScanner thread holds thousands of ChunkSections as a GC root ~1.4 GB per transition
Create Renderer caches hold references to old world data Variable
Chunk storage Old world's ChunkManager retains all loaded chunks in memory ~1-3 GB per transition

How it works

The mod uses a two-phase approach:

Compatibility

Log output

The mod logs everything it does. Example output after a dimension change:

[DimensionLeakFix] Dimension change detected, cleaning up old world...
[DimensionLeakFix]   Entities: 131 world references detached
[DimensionLeakFix]   Collective: 1 cache(s) flushed in cachedBlockEntities
[DimensionLeakFix]   AmbientSounds: scanner stopped (3 fields cleared)
[DimensionLeakFix]   Create: renderer cache invalidated
[DimensionLeakFix] Phase A complete (137 operations)
[DimensionLeakFix] Phase B scheduled (3s delay)
[DimensionLeakFix] Phase B: releasing old world data...
[DimensionLeakFix]   Chunks: 2809 slots released
[DimensionLeakFix]   loadedChunks: 2809 entries cleared
[DimensionLeakFix] Phase B complete (2810 references released, ~3706 MB freed)

Used in the Legends Reborn: Medieval modpack.

Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more