Lag usually comes from the server’s CPU, not its memory. Measure first, then fix what the numbers point to.
1 Measure with spark
A healthy server runs at 20 TPS (ticks per second). Recent Paper versions include spark; on older ones, install it as a plugin. Check TPS, then run the profiler while the lag is happening:
spark tps
spark profiler start
spark profiler stop
Stopping gives you a link that shows exactly which plugins, entities or chunks take the time.
2 Lower view and simulation distance
In server.properties, these two settings have the biggest effect:
view-distance=8
simulation-distance=6
3 Pre-generate the world
Generating new chunks is expensive. Set a world border and pre-generate inside it with Chunky while nobody is playing:
chunky radius 5000
chunky start
4 Tame the entities
Huge mob farms, piles of dropped items and hundreds of villagers are common causes. spark shows where they are.
5 Check your plugins
If spark points at a plugin, update it, configure it, or replace it with a lighter one.
6 Check memory last
If memory is constantly full, the server pauses to clean up, which feels like lag. Then a bigger plan helps. If memory isn’t full, more RAM won’t fix it. Not sure? Ask us on Discord with your spark link.