---
title: "Optimizing Your Minecraft Server for Large Modpacks"
description: "JVM flags, view distance, pre-generation, and the performance mods worth installing before you invite 20 people onto an All The Mods server."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.vaelix.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Optimizing Your Minecraft Server for Large Modpacks

What JVM flags and settings actually fix modded Minecraft lag? Use Aikar's G1GC JVM flags, allocate RAM based on your modpack size (4–16 GB) rather than your budget, and drop view and simulation distance before adding more RAM. Then pre-generate the world with Chunky, and add performance mods like Lithium or ModernFix alongside your content mods.

## Pick RAM based on your modpack, not your budget

More RAM isn't automatically better. Too much heap makes **garbage collection pauses longer and less frequent**, which shows up as stutters, not smooth play.

Start at **4–6 GB** for a light pack, **8–10 GB** for a medium pack, and **12–16 GB** for kitchen-sink packs like All The Mods 10. See our [full RAM guide](/minecraft/how-much-ram-for-a-minecraft-server) for server types and player counts.

> **Tip:** Watch your panel's memory graph after launch. If usage plateaus well under your allocation, scale down.

## Use Aikar's flags for garbage collection

Minecraft's memory pattern doesn't suit the default JVM garbage collector. **Aikar's flags** are a proven G1GC config that cuts GC-related lag spikes.

Paste them into your **JVM arguments** field in your panel.

```text
-XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1
```

## Tune view and simulation distance before adding more RAM

**View distance** is one of the most expensive settings on a modded server. Dropping it often recovers more performance than doubling your RAM. Try 8 for `view-distance` and 6 to 8 for `simulation-distance`.

| Setting | File | Default | Recommended |
|---|---|---|---|
| `view-distance` | `server.properties` | 10 | 8 |
| `simulation-distance` | `server.properties` | 10 | 6–8 |

## Pre-generate the world before players explore it

Generating new chunks live is far more expensive than loading ones that already exist. Use **Chunky** to pre-generate a radius around spawn before opening the server.

A **5,000–10,000 block** radius covers most early exploration for a small community.

## Add performance mods alongside your content mods

Performance mods don't add content. They make your existing pack **run faster**.

- **Fabric:** Lithium, FerriteCore, Krypton
- **Forge / NeoForge:** ModernFix, FerriteCore

Rendering mods like Sodium and Embeddium are client-side only and do nothing for a server.

## Watch TPS and MSPT, not just RAM usage

**TPS** (target 20) and **MSPT** (target under 50 ms) show whether the server keeps up. RAM usage alone doesn't tell you that.

**Spark** reports both on any loader with `/spark tps`, and Forge and NeoForge also have their own tps command. Rising MSPT is your signal to revisit view distance before adding more content.

## Frequently asked questions

### How much RAM does a modded Minecraft server need?

Start at 4 to 6 GB for a light pack, 8 to 10 GB for a medium pack, and 12 to 16 GB for kitchen-sink packs like All The Mods 10. More is not automatically better, because too much heap makes garbage collection pauses longer.

### What are Aikar's flags?

A proven set of G1GC JVM arguments that cuts garbage collection lag spikes on Minecraft servers. Paste them into the JVM arguments field in your panel.

### Should I lower view distance before adding more RAM?

Yes. View distance is one of the most expensive settings on a modded server, and dropping it often recovers more performance than doubling your RAM. Try 8 for `view-distance` and 6 to 8 for `simulation-distance`.

Source: https://docs.vaelix.cloud/minecraft/optimizing-modded-minecraft/index.mdx
