RAM is the one spec you actually choose when you set up a Minecraft server, so here's the direct answer first, then the reasoning for your specific case.
The sizing table
- 2 GB — vanilla, 2–4 players near spawn. The true minimum, not the comfortable one.
- 4 GB — vanilla up to ~10 players, or a small Paper server with essential plugins. The friend-group sweet spot.
- 6 GB — plugin-heavy Paper (20+ plugins) or light modded (20–50 mods).
- 8 GB — proper modpacks: Better MC, Pixelmon, Cobblemon with sidemods, mid-size Forge/Fabric sets.
- 10–12 GB — kitchen-sink packs (All the Mods, RLCraft with company) or modded servers with 10+ concurrent players.
What actually eats the memory
Not players directly — loaded chunks. The server keeps a radius of world loaded around every player, so ten players in one base cost far less than ten explorers in ten directions. Mods are the other multiplier: each one loads its content permanently into memory, which is why a 200-mod pack idles at 5 GB before the first player joins. View distance scales chunk memory quadratically — dropping it from 12 to 8 is the cheapest "more RAM" there is.
Symptoms of getting it wrong
Too little RAM looks like: long garbage-collection freezes (everyone rubber-bands at once), crashes with OutOfMemoryErrorin the log, and save times stretching. Too much is subtler — giant heaps make Java's garbage collector do rarer but longer sweeps, so a 16 GB allocation for a vanilla server can stutter more than 4 GB.
If the server holds a steady 20 TPS but players still complain, the bottleneck is almost never RAM — it's single-core CPU speed, world generation, or one misbehaving mod. More memory won't fix those.
Self-hosting? Leave headroom
The -Xmx flag caps the Java heap, but the OS and the JVM itself need room on top. On an 8 GB machine, allocate 6 GB at most; on the PC you also play on, halve everything. Hosted plans state the allocation you actually get, which makes the table above map directly to a tier — and upgrading later is one click instead of a hardware purchase.