A memory leak is different from a server simply needing more RAM. Normal usage rises and falls as the garbage collector runs; a leak climbs steadily over hours or days and never comes back down, even after garbage collection, until the server eventually runs out of memory and crashes or needs a restart.
Confirming it's actually a leak
Watch memory usage over an extended period, ideally with spark's health monitoring or your host's resource graphs, if it does not have a natural sawtooth pattern (rises, then drops sharply during a GC pass) and instead trends steadily upward regardless of player count or activity, that pattern points to a leak rather than normal allocation behavior.
What usually causes it
Memory leaks on Minecraft servers are almost always caused by a plugin or mod holding references it never releases, cached player data that is never cleared on disconnect, an event listener that keeps growing a list without bound, or a scheduled task that accumulates state over time. Vanilla server code and well-maintained plugins rarely leak; the culprit is very often a specific, less actively maintained plugin.
Finding the culprit with a heap dump
Spark can take a full heap snapshot directly:
/spark heapdump --compress xz
This produces an HPROF file you can analyze with a tool like Eclipse MAT (free) to see exactly which classes are holding an abnormal number of retained objects, this almost always points directly at the responsible plugin by name. Spark's lighter-weight /spark heapsummary command gives a quicker class-level overview if a full dump feels like overkill for a first look.
A quicker first pass
Before diving into a full heap dump, try disabling recently added or rarely updated plugins one at a time (with a restart between each) and watching whether the leak pattern stops, this is slower than a heap dump but requires no additional tools if you just want to narrow things down quickly.
Fixing it
Once you have identified the plugin, check for a newer version first, many memory leaks get fixed silently in later releases without an explicit changelog entry. If no fix exists, removing the plugin (see our removal guide) or switching to an actively maintained alternative is usually the only real fix, a scheduled restart reduces the symptom but does not address the underlying leak.
Restarts as a stopgap, not a solution
A nightly restart keeps a known leak from crashing the server, but it is a workaround, not a fix, the underlying plugin is still leaking, just being reset before it becomes catastrophic. Prioritize actually finding and removing the cause.
Getting help diagnosing it
Tick Hosting's panel includes resource graphs that make a leak's steady-climb pattern easy to spot at a glance. Available on every plan, including the free tier, from Tick Hosting's plans page.