Documentation
Quick start & JVM tuning
Recommended JVM memory flags, what to expect in Task Manager vs F3, and verifying v0.4.9 in-game.
Once mtr-memory-saver-0.4.9-mtr4.1.0-beta.2-mc1.21.1-neoforge21.1.265.jar is inside mods/, adjust your launcher memory cap and verify the mod in NeoForge.
Recommended JVM flags
For heavy collections (such as the 16-pack test fixture with 1,092 declarations / 2,541 legacy vehicles), start with:
-Xms512M -Xmx3072M -XX:+UseG1GC
-Xmx3072M(3 GiB) is the verified minimum heap cap for both startup and consecutiveF3+Treloads.- If your modpack includes many terrain, shader, or non-MTR content mods alongside MTR, allocate
4 GiB(-Xmx4096M) so other mods have headroom. - Keep your resource pack ZIPs compressed or extracted as usual inside
resourcepacks/— Memory Saver handles deduplication and bounded streaming transparently at load time.
Java heap vs Windows process RAM
Players often inspect Task Manager alongside Minecraft’s F3 screen:
-Xmx3072Mlimits only the Java heap (steady sampled heap measured at2.30–2.35 GiBacross native-catalogue fixtures, and2.07–2.65 GiBduring isolated0.4.9in-world captures).- Native OpenGL buffers, Zlib/Deflater allocations, metaspace, and JVM overhead still live outside
-Xmx. Total Windows Working Set / Private Commit on the 16-pack fixture runs around4.25–4.47 GiBsteady (and4.39–5.86 GiBduring heavy20-reload stress cycles).
Verifying in-game
- Launch Minecraft
1.21.1(NeoForge 21.1.265) and open Mods from the title screen. - Confirm MTR Memory Saver displays version
0.4.9, Mod IDmtr_memory_sharing, the RAM-iconpack.png, andA-BenLi06under authors. - Join a world with MTR stations and trains, open
F3, and verify your client runs stably under3072MBallocated heap.
Reloading resource packs (F3+T)
Unlike unmodified MTR (or earlier 0.4.7 builds before single-channel generation cleanup), the streaming runtime in 0.4.9 / 0.4.8 atomically retires previous reload generations via beginReload() and keeps .bbmodel, .obj, and .mtl scratch channels DELETE_ON_CLOSE. In isolated -Xmx3072M validation, the identical 0.4.8 bytecode survived 20 / 20 consecutive F3+T reloads with zero OOMs.
Advanced Flags & Internals
For all 7 -Dmtr.memory.* JVM properties (reader/parser concurrency, queue depth, 96 MiB LRU budget) and the boundary between local cache budgets and total OS RAM, see Technical principles and Runtime contract & review.