Wiki 9Minecraft Wiki 9Minecraft
Memory Sweep Wiki › Guides › How to Manually Clear Memory In-Game

How to Manually Clear Memory In-Game

When exploring new chunks, fighting large groups of mobs, or playing long sessions, Minecraft's allocated RAM can fill up faster than the automatic cleanup schedule expects. Memory Sweep Mod lets you force garbage collection on demand without restarting your game.

Checking Current Memory Usage

Before running a manual sweep, you can check whether high memory usage is actually causing your lag spikes:

1. Press F3 on your keyboard to open the vanilla debug screen.

2. Look at the top-right corner of the screen to see your current memory percentage and allocated RAM.

3. If the percentage is climbing rapidly or hovering near its limit, clearing memory manually can help stabilize your frame rate.

Running the Manual Cleanup Command

To trigger garbage collection immediately during gameplay:

1. Open the in-game chat window by pressing T (or / to start typing a command directly).

2. Type /memorysweep into the chat bar.

3. Press Enter to execute the command.

Note that in singleplayer worlds or multiplayer servers, running commands may require cheats or operator permissions to be enabled. Once triggered, the mod immediately calls garbage collection to free up unused memory. You may notice a brief pause right as the sweep runs, followed by lower memory numbers on the F3 screen and smoother performance.