Skip to content

Why does SquidServers recommend a maximum of 12GB of RAM?

Allocating excessive RAM to a Minecraft server can actually degrade performance rather than improve it.

The Role of the Java Garbage Collector (GC)

Section titled “The Role of the Java Garbage Collector (GC)”

The Java Garbage Collector runs periodically to clean up unused memory. It triggers more frequently as the server approaches the Xmx (maximum RAM) limit.

  • The Problem: When the GC runs, it temporarily “hangs” the server. The server effectively pauses (0 TPS) while the GC completes its task.
  • The Trade-off: With moderate RAM allocations, these pauses are unnoticeable. However, if you allocate too much RAM, the GC has a massive amount of data to process. This results in longer, more noticeable pauses, causing visible in-game lag.

The “ideal” amount of RAM depends on several factors:

  • CPU Speed: Higher-end CPUs can process the Garbage Collector tasks much faster, allowing them to handle more RAM without significant pauses.
  • Memory Speed: Faster RAM helps the GC process data more efficiently.
  • Server Load: The number of players, mods, and plugins also dictates memory needs.

Recommendation: On most modern machines, 12GB is often the threshold where the performance cost of the Java GC begins to outweigh the benefits of having extra memory. Increasing it beyond this point often leads to worse performance unless your system is exceptionally powerful.

See Hardware Requirements for more detailed recommendations.