Menu
 

Project Zomboid Server Memory Guide: RAM Per Player & OOM Fixes (2026)

Project Zomboid Server Memory: How Much RAM Does Your PZ Server Need?

Running a stable Project Zomboid dedicated server comes down to one thing more than any other: giving the Java Virtual Machine enough heap memory. Too little RAM and players see "Connection lost," chunk-load stalls, item duplication, and eventually OutOfMemoryError crashes. This guide gives you the real-world numbers we see across hundreds of hosted PZ servers, the exact -Xmx flag to set, and how to diagnose RAM-related crashes.

Quick rule of thumb: Vanilla PZ multiplayer needs 3 GB base + 0.5 GB per player. Modded servers need 6 GB base + 1 GB per player. Build 42 servers need at least 50% more than equivalent Build 41 setups.

RAM Allocation Table (Real-World Numbers)

SetupPlayersBuild 41 RAMBuild 42 RAM
Vanilla, small group2-44 GB6 GB
Vanilla, medium4-86 GB8 GB
Vanilla, large8-168 GB12 GB
Light mods (5-15 mods, no map packs)4-88 GB10 GB
Medium mods (Brita's, ORGM, simple QoL stack)8-1610-12 GB14-16 GB
Heavy mods (Eerie Country, Brita's, Vehicle Mods, MapPacks)16-3214-16 GB20-24 GB
Mega-modded RP server32+20-24 GB28-32 GB

These are JVM heap (the -Xmx value), not total system RAM. Your host needs at least 1-2 GB beyond the heap for OS overhead and Steam updates.

Where to Set the Memory Flag

Self-Hosted (Linux Dedicated Server)

The PZ dedicated server reads memory flags from start-server.sh in your install directory. Edit the -Xmx value:

# In ~/Zomboid/start-server.sh or ~/pzserver/start-server.sh ./ProjectZomboid64 -Xms6g -Xmx12g -Dzomboid.steam=1 -Dzomboid.znetlog=1 \ -- -cachedir=/home/pzserver/Zomboid

Set -Xms (initial) equal to or about half of -Xmx (max). Don't set -Xmx higher than 75% of total system RAM — leave headroom for the OS.

Self-Hosted (Windows Dedicated Server)

Windows uses StartServer64.bat (in the install root). Open it in Notepad++ and find:

"%~dp0jre64\bin\java.exe" -Xms6g -Xmx12g -Djava.awt.headless=true ...

Steam Workshop "Host Server" (in-game)

The Host Server menu in PZ has a RAM slider. Max is whatever your client RAM supports. Don't use Host Server for serious multiplayer — it shares memory with the client, and 32 GB clients still struggle past 6-8 modded players.

Managed Hosting

If you're on a managed host (us included), RAM is set by your plan tier and you don't edit -Xmx directly. Supercraft Project Zomboid plans start at $5.99/mo with Plan S (8 GB), Plan M (16 GB), Plan L (32 GB). Modded servers should pick Plan M or higher.

OOM Symptoms — Recognize the Pattern

"Connection lost" for everyone simultaneously

The JVM ran out of heap. All clients drop at once. Logs show java.lang.OutOfMemoryError: Java heap space. Fix: bump -Xmx by 50%, restart.

Server lags worse over hours, recovers after restart

Memory leak from a mod or accumulated garbage collection pressure. Fix: schedule a daily restart; check mod compatibility list; consider -XX:+UseG1GC if not already set.

Items duplicating, vehicles vanishing

Often a side-effect of forced GC pauses when the heap is near full. The server stalls, packets re-fire, state desyncs. Fix: more RAM solves it.

Player can't load — stuck on "Initializing"

Sometimes RAM-related when chunk-load times out. See our PZ Server Stuck on Initializing guide for the full diagnostic flow.

Server starts then dies in 30 seconds

-Xmx set higher than the system has free. Java fails to allocate the heap and aborts. Check free -h on Linux or Task Manager on Windows.

"Server terminated" message in PZ logs

OOM, JVM crash, or system OOM-killer. See our PZ Server Terminated diagnostic.

Build 41 vs Build 42 Memory Behavior

Build 42 is a different story for memory. The new chunk format, animal AI, basement system, and crafting overhaul all push Java heap usage well above Build 41 baselines. Specific patterns we see:

  • Animal spawning is the biggest single driver. A Build 42 server with the default animal density uses about 35% more RAM than vanilla Build 41 same-player-count.
  • Basements load on demand, but every loaded basement chunk holds in memory until the player leaves an exterior cell.
  • The new crafting tree retains a per-player cache that doesn't release between sessions.
  • Mod ecosystem isn't fully Build 42 compatible yet. Many mods leak heap on Build 42 because they hold references the new architecture changed. Wait 2-4 weeks after a major Build 42 patch before adding a mod to a serious server.

Garbage Collection Tuning (Advanced)

For servers with 12+ GB heap, the JVM's default GC choices stop being optimal. Add these flags to start-server.sh:

-XX:+UseG1GC \ -XX:MaxGCPauseMillis=200 \ -XX:+ParallelRefProcEnabled \ -XX:+UnlockExperimentalVMOptions \ -XX:+UseStringDeduplication

G1GC keeps pause times predictable, which matters more than raw throughput for game servers. MaxGCPauseMillis=200 tells the GC to chunk its work to keep pauses under 200ms — players experience these as imperceptible micro-stutters rather than 1-2 second freezes.

Diagnosing a Memory Issue Before It Crashes

  1. Tail server logs and grep for OutOfMemory: tail -f Zomboid/server-console.txt | grep -i memory
  2. Watch JVM heap: jcmd $(pgrep java) GC.heap_info
  3. Watch system RAM: watch -n 5 free -h
  4. If heap usage stays >85% during peak hours, you need more RAM. Period.

Common Mistakes

  • Setting -Xmx equal to total system RAM. Java can't actually allocate that much (OS overhead, kernel reservations). Use 75-80% of total at most.
  • Running the dedicated server alongside a graphical desktop. X11 / GNOME chews 1-2 GB you could give to PZ.
  • Ignoring swap. A small swap (4-8 GB) saves you from hard crashes when allocation spikes briefly.
  • Not restarting after mod updates. Mods that change tile data or items often leak old references on hot-reload. Restart cleanly.

Related Project Zomboid Guides

Skip the RAM math? Rent a managed PZ server starting at $5.99/mo — Plan S includes 8 GB, Plan M 16 GB, Plan L 32 GB. Tuned start-server.sh with G1GC, automatic backups, mod-version pinning, 5 datacenter regions, and 2-day refund.

Tired of fighting this issue every patch?

Run a managed Project Zomboid server with us — we handle the patches, mod-version pinning, save backups, and DDoS protection. Set up in 3 minutes, 5 datacenter regions, no contract.

See Project Zomboid hosting plans →
Top