Direct answer

Allocate enough RAM for the server's real workload, but do not give Java all available system memory. A small Paper server for a few friends often starts comfortably in the 2–4 GB range, while large plugin sets, high player counts, or modpacks can need more. CPU performance, world generation, entities, and plugins can become the bottleneck long before RAM is full.

Set the heap in the start command

java -Xms2G -Xmx4G -jar paper.jar --nogui

Here, Java starts with a 2 GB heap target and can grow up to 4 GB. The exact values are not a universal recommendation; they are an example.

Do not allocate all physical RAM

The operating system, Java itself, filesystem cache, hosting panel, proxy, database, backups, and monitoring tools also use memory. If a 16 GB machine gives the Minecraft process 16 GB, the rest of the system has no room to work normally.

More RAM does not fix every lag problem

If TPS falls because the main tick is overloaded, adding memory may do nothing. High entity counts, chunk generation, expensive plugins, redstone, storage latency, or a slow CPU can still cause lag. Profile the server before buying or allocating more memory blindly.

When to increase RAM

  • The process is regularly close to its heap limit.
  • You see memory-related crashes or repeated out-of-memory errors.
  • A modpack's official server requirements recommend more memory.
  • Your measured workload grew after adding players, dimensions, plugins, or mods.

Use the MSH calculator as an estimate

MSH's server resource calculator can give you a starting estimate based on players, software, plugins/mods, optimization level, CPU characteristics, and other workload factors. Treat the output as planning guidance and validate it with real server metrics.

Check the actual allocation
  1. Read the launch command or panel JVM arguments and confirm both -Xms and -Xmx. -Xmx limits Java heap, not the full process memory footprint.
  2. Leave capacity for direct memory, thread stacks, OS cache and a proxy/database on the same machine. A container with 4 GiB total memory should not automatically receive -Xmx4G.
  3. Compare GC behavior and peak use during normal play; if MSPT remains high with comfortable heap headroom, profile CPU work instead of adding more RAM.

Official references

These references were checked while preparing this guide. Version-specific behavior can change, so use the project documentation for your exact release when a detail differs.

Was this article helpful?
Help us improve this article

Tell us what is missing, unclear, outdated, or incorrect. You can also suggest something we should add.

What could we improve?
Do not include passwords, server IPs, or other private information.0 / 1000