MemGuard

Quick rating

MemGuard

No reviews yet

Reduces RAM usage in large modpacks and servers by caching NBT strings, monitoring memory usage, and triggering garbage collection at optimal times.

No Theme
No Genre
Performance & Optimization
Server Utility
Mod Loaders
Forge
NeoForge
Fabric
Minecraft

Community voices

Reviews

Versions
Loading versions…
Match includes

Click once to include, again to exclude, again to clear

Rating Any
Any 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0
Min
Max
Play Status
Reviews
Time Played
hrs+
Verified developers only
Has developer response
List view
Grid view
Compact view
Sort by
Date
Rating
Helpful
Unhelpful
Edited
Sort ascending
Delete this review?

This removes your review from the project. You can write a new review after.

Review submitted for moderation

Your review has been sent to moderators, who will check that it meets our guidelines before it appears publicly.

No reviews yet. Be the first to review this project!

Get it on

Available Platforms

Compatibility

Supported Environments

Dev Environment
Client Optional
Server Optional

About

Project Details

Type
Mod
License
All Rights Reserved
Latest Version
MemGuardNeoForge v.1.0.4
Authors
CurseForge
Modrinth

For authors

Embed Badge

If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.

Custom banner text
ModDex rating badge preview

Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.

Identifiers

Platform IDs

CurseForge ID
Modrinth ID

Resources

External Links

Source Issues Wiki Discord

About

Description

MemGuard

Smart RAM control for modded Minecraft.
Less stutter. Fewer freeze spikes. Better long-session stability.

Minecraft Forge NeoForge Fabric Java


Why Players Install MemGuard

  • Stabilizes memory usage in big modpacks and long play sessions.
  • Cuts duplicate NBT string allocations to reduce RAM pressure.
  • Adds memory warnings before your session becomes unstable.
  • Runs safely with standard loader/JVM APIs (no native hooks).

Feature Highlights

Periodic GC Assist
Triggers safe periodic cleanup to limit long-session memory buildup.
NBT String Dedup Cache
Reuses repeated hot strings instead of reallocating them thousands of times.
Memory Pressure Monitor
Warns in logs when heap usage gets risky.
Texture Upload Cleanup
Client-side cleanup path reduces unnecessary memory retention after atlas upload.

Supported Versions

Loader Minecraft Java
Forge 1.20.2+ 21+
NeoForge 1.21+ 21+
Fabric 1.21+ 21+

Check the Files tab for exact build mapping per version.

Compatibility Notes

  • Known good with FerriteCore and AllTheLeaks.
  • If logs mention missing Create classes, verify Create and Create addons are on the same update line (Update 5 with Update 5 addons, or Update 6 with Update 6 addons).
  • That Create class mismatch is usually not caused by MemGuard itself.

Quick Install

  1. Install the correct loader for your Minecraft version.
  2. Use Java 21+.
  3. Put MemGuard.jar in your mods folder.
  4. Start the game and check latest.log for [MemGuard] entries.

Build smoother modpacks, not restart loops.
Use MemGuard when your world is big and your sessions are long.

MemGuard

Lean memory behavior for long Minecraft sessions.

MemGuard is a lightweight utility mod for Fabric / Forge / NeoForge (Minecraft 1.21.1) focused on reducing avoidable allocations and making memory pressure easier to observe.

What MemGuard does

1. Reuses repeated short NBT strings

  • Hook: NbtString.of(...)
  • Repeated short values are reused through an LRU cache (up to 2048 entries).
  • This reduces duplicate object allocations for common IDs/tags in larger modpacks.

2. Logs periodic heap snapshots

  • Heap usage is sampled from server tick context.
  • Warning logs are emitted when configured usage thresholds are exceeded.
  • Intended for visibility and troubleshooting, not as a direct performance claim.

3. Tracks texture-atlas lifecycle (client)

  • On atlas upload completion, MemGuard logs heap-used values in debug context.
  • This helps correlate load phases with memory behavior.

Technical notes

  • Uses mixin hooks for targeted behavior (NbtCacheMixin, ServerChunkManagerMixin / ChunkCacheMixin, TextureCacheMixin).
  • No native code, no unsafe memory access.
  • System.gc() is not used to force garbage collection.

Important accuracy notes

  • MemGuard does not guarantee fixed FPS/MSPT/MB improvements.
  • Real impact depends on modpack size, entity/world state, JVM vendor/flags, and session length.
  • Expected benefit is typically higher in medium/large packs with repeated NBT patterns.

Reproducible evaluation (recommended)

To evaluate MemGuard for your own setup, compare baseline vs. MemGuard under identical conditions:

  1. Same Java version, JVM args, mod list, world seed, and config.
  2. Same runtime window (recommended: 30-60 minutes per run).
  3. At least 3 baseline runs + 3 MemGuard runs.
  4. Collect comparable metrics:
  • p50/p95 MSPT (spark or similar)
  • heap usage trend from logs
  • allocation/GC event data (JFR or similar)
  1. Compare distributions (median/p95), not single spikes.

Installation

Fabric

  1. Install Fabric Loader (0.16+)
  2. Install Fabric API
  3. Place MemGuard jar in mods/

Forge / NeoForge

  1. Install the matching loader for your Minecraft version
  2. Place MemGuard jar in mods/

Compatibility

  • Designed to work alongside common optimization mods.
  • As with any mixin-based mod, test your exact modpack before production deployment.

Screenshots

Gallery

This project has no gallery images yet.

Versions

Files

Relations

Project Relations

More like this

Similar Mods

Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.

On ModDex

Community snapshot

0
Ratings
0
Followers
0
In stacks

By the numbers

Statistics

~200,000
Total Downloads
CurseForge
~180,000
Modrinth
~21,000
Last Updated
CurseForge
Modrinth
Created
CurseForge
Modrinth
Last synced
When ModDex last fetched this project from CurseForge or Modrinth. Every project is re-checked on a schedule, and any project that ships a new file is synced automatically within hours of the release.
New file updates sync automatically
How syncing works