What changes memory usage
- Player count and how spread out players are in the world.
- View distance, simulation distance and chunk generation.
- Plugins and their data sets.
- Modpacks, especially large content-heavy packs.
- Multiple dimensions or worlds.
- Other applications running on the same PC.
Leave memory for Windows
Do not allocate nearly all physical RAM to Java. Windows, background services and the Minecraft client need memory too. If the host starts paging heavily to disk, giving the server an oversized heap can make the overall experience worse instead of better.
Start conservative and measure
For a small friends-only server, start with a modest allocation that leaves comfortable headroom on the machine. Increase it only when monitoring or real workload shows memory pressure. Large modpacks may require substantially more than a lightweight Paper or Vanilla server.
RAM does not fix every lag problem
Low TPS can be caused by CPU-heavy ticks, chunk generation, entities, plugins, mods, storage latency or network issues. If the server has unused heap but still lags, adding more RAM is unlikely to solve the root cause.