MemoryMaster — Server-Side Heap Memory Optimization Mod
For NeoForge 1.21.1, server-side only; no client installation required.
All 7 modules are enabled by default and can be disabled individually. Each module's mixins are kept in separate files, so a problem in one module won't affect the others.
Safety is a design prerequisite:
- The mixin plugin only validates target classes through resource lookup and does not load any classes (avoiding disruption of other mods' injection timing).
- All injections use
require = 0, and the mixin config usesrequired = false. - All optimization logic is wrapped in try-catch; on exception it falls back to vanilla behavior and logs it.
- There is a self-check at the transform stage and another after server startup to confirm whether injection points actually took effect; behavior-type injection points that didn't take effect are automatically downgraded.
- The mixin config uses
priority = 9999, applied after other mods. - After startup it scans other mods' mixins and proactively yields and writes to config when write-type overlap is found.
/mmcmf panicdisables all optimizations with one command.
Modules
- structures — Structure template cache LRU cap (default 30; the only write-type optimization enabled by default)
- diagnose — Read-only diagnostics:
/mmcmf report,/mmcmf diagnose, JFR 96–128 byte allocation tracking - guava — Guava immutable collection duplication measurement (write rewriting disabled by default)
- bytepool —
byte[]bucketed pool (16/32/64/128 KB; pooling application disabled by default) - objpool — Collection capacity pre-allocation based on historical peaks (disabled by default; cross-session learning)
- smallobj — Creation-count statistics for BlockPos / ItemStack / advancement objects
- secondopt — Conflict detection with FerriteCore/ModernFix/C2ME/Clumps, read-only leak observation, yielding
Commands
/mmcmf status— Module status and injection point self-check/mmcmf report— JVM memory + memory-saving statistics (resident and allocation amounts calculated separately)/mmcmf diagnose [smallobj|leaks|mods]/mmcmf optimize|disable <module>|all/mmcmf panic | unpanic | reload
It should be noted: the only write-type optimization enabled by default is the structure template cache cap; the rest are measurement and optional experiments.
The real memory hogs are still view distance / simulation distance, ModernFix's dynamic_resources, and FerriteCore — this mod does not replace them.

