SANDBOX — this is a test environment. No servers are actually deployed and no real payments are charged.
✓ VerifiedGameplay & overhauls

MemGuard

by SeishiroNagi · for Minecraft

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

47KDownloads
4 mo agoLast updated
LicenseRef-All-Rights-ReservedLicense
Fabric · Forge +1Loaders

About MemGuard

From Modrinth

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

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.

Highlights

From source data

Game versions

Supports 19 Minecraft versions, the newest being 1.21.11.

Loaders

Runs on Fabric, Forge and NeoForge.

Footprint

Rated a light load on a server.

What kind of mod it is

From the catalog
Listed on Modrinth as “Mods”

Gameplay & overhauls

New mechanics, content and overhauls that change how the game plays.

Runs on your server

From source side support

Modrinth lists MemGuard as required on the server. Check its Modrinth page to see whether players need it too.

Compatibility

Game
Minecraft
Loaders
FabricForgeNeoForge
Runs on
Serverrequired on the server
Game versions
1.21.11 and 18 earlier

Verified at the source

  • ✓ModrinthOfficial listing, checked 2026-10-01Open ↗
  • ✓AuthorSeishiroNagi, as published on Modrinth
  • ✓LicenseLicenseRef-All-Rights-ReservedFree

MemGuard, answered

Generated from the mod’s own source data.

Do my players need to install MemGuard?

Modrinth lists MemGuard as required on the server. Check its Modrinth page to see whether players need it too.

Which loaders does it support?

Fabric, Forge and NeoForge.

Is it free?

Yes. MemGuard is free to download from Modrinth. Its license is LicenseRef-All-Rights-Reserved.

How do I add it to my Nxeon server?

Use “Add to a server” on this page, or open NxLabs from your dashboard. We install it, restart your server and switch it on.

NxLabs

Run MemGuard on a Minecraft server.

Deploy in about a minute from $4.20 a month, then add MemGuard in one click.