Production debuggingSenior

The service OOMs every thirty hours, and a restart fixes it

A JVM service dies with OutOfMemoryError roughly every thirty hours and comes back healthy. Someone has put it on a nightly restart and the pages stopped, which is why nobody has looked at it in three weeks.

There is nothing to run here. Say what you would look at first and why — the order is the answer, not the diagnosis.

Constraints

  • Traffic is flat across the whole cycle — this is not growth.
  • The service is not leaking threads or classes; both counts are steady.

Hints

Hint 1
One of these numbers means something the others do not. Ask which readings survive a full collection.
Hint 2
An undersized heap and a leak both raise GC time. Only one of them raises the floor.
Hint 3
A restart fixing it is not a clue about the cause — every heap problem is fixed by a restart.

Stuck? The lesson behind this problem: ⚙️ Garbage collection

What the dashboard says

Heap after full GC400MB → 1.6GB over 30h
Max heap2GB, unchanged
GC pause40ms → 900ms
Time spent in GC2% → 35%
Request rateunchanged
Metaspaceflat
Live threads212, flat
After restartback to 400MB, cycle repeats

Every one of these is a real cause of OutOfMemoryError. Which one do these numbers actually support?

Pick one first — the answer stays hidden until you do.