Release 2.0
Forge & Neoforge versions available !
A Minecraft Mod that Cleans Memory before it reaches 100% , therefore not causing any Stuttering when the allocated memory reaches It's limit.
Author: zSouul
/memoryfreeze advice suggests launcher arguments based on numbers it measured on your machine./memoryfreeze diagnose writes a heap report grouped by mod, so you can see which mod is holding memory.These exist on the server (trim, deepclean, diagnose, reload and hud need operator level 2) and on the client with the same names, so they work in singleplayer and on any server. The client versions only affect your own game.
| Command | What it does |
|---|---|
/memoryfreeze status |
Health check result, GC overhead, longest pause, live data, last cleanup |
/memoryfreeze advice |
Suggested launcher arguments for your machine |
/memoryfreeze trim |
Cleans up now if the pause would be short, otherwise waits for the next safe moment |
/memoryfreeze deepclean |
Cleans up right now, however long the pause is |
/memoryfreeze diagnose |
Heap report grouped by mod, saved to a file |
/memoryfreeze reset |
Client only. Leaves and rejoins the current world or server, which frees the memory the world was holding |
/memoryfreeze reload |
Reloads the config file |
/memoryfreeze hud |
Turns the on-screen meter on or off |
There are also three keybinds (unbound by default) under Options > Controls > MemoryFreeze Fix: deep clean, full reset and heap report. They work on the title screen too.
Use the config screen or edit config/memoryfreeze-fix.json. Values outside the allowed range are corrected when the file is loaded. A config from the old 1.x version is converted automatically and the old file is kept as memoryfreeze-fix.v1.json.bak.
| Option | Default | What it does |
|---|---|---|
autoCleanupEnabled |
true | Allow automatic cleanups (safe moments only) |
cleanupMinUsedPercent |
50 | Skip cleanups while the heap is emptier than this |
cleanupMinReclaimMB |
256 | Skip cleanups unless the old generation grew this much since its lowest point after a GC |
cleanupCooldownSeconds |
120 | Minimum time between automatic cleanups (it grows if cleanups free little) |
safeMomentGraceMillis |
1500 | How long a safe moment has to last before a cleanup starts |
cleanupOnPauseMenu |
false | Also clean up in the pause menu. This can cause a small hitch, and the periodic GC already handles a paused game |
cleanupWhenUnfocused |
true | Also clean up while the window is unfocused or minimized |
gameplayPauseBudgetMs |
0 | Advanced. Above 0, a cleanup may also run during gameplay if the heap is nearly full and the expected pause is no longer than this |
gameplayPressurePercent |
92 | Heap percentage where the budget above applies |
deepCleanMaxPasses |
1 | GC passes for a manual deep clean |
runtimeTuningEnabled |
true | Turn on G1's periodic GC while the game runs |
g1PeriodicGcIntervalSeconds |
15 | Seconds without a GC before G1 starts a background cycle |
healthAdviceEnabled |
true | Show a chat message when the health check finds a problem |
undersizedLivePercent |
70 | If more than this share of -Xmx is still live after a full GC, the heap is too small |
longPauseMs |
250 | A GC pause at least this long counts as a long pause |
autoDiagnoseEnabled |
true | Write a heap report on its own (safe moments only) when the heap is too small or a leak is suspected |
autoDiagnoseAfterSeconds |
120 | How long the problem has to last first |
autoDiagnoseCooldownSeconds |
900 | Minimum time between automatic reports |
pollIntervalMillis |
1000 | How often the watchdog checks things |
hudEnabled |
false | Show the memory meter in the top left |
hudDetails |
true | Also show GC overhead, longest pause and live data |
chatNotifications |
true | Show chat messages for important events. Results of commands you run are always shown |
verboseChat |
false | Also show a message for every automatic cleanup |
logJvmAdviceOnStartup |
true | Log launcher argument suggestions on startup if your setup looks off |
/memoryfreeze reset, give the game more memory, or look at what the heap report shows./memoryfreeze advice shows the flags for your Java version.-XX:+DisableExplicitGC, GC calls do nothing. The mod notices this and tells you.jdk.management module for GC events and the runtime tuning. The Java runtimes that come with Minecraft have it. Without it the mod falls back to rough polling and skips the tuning.