Skip to content

Run GC

Run GC asks the JVM to perform a garbage collection on the selected instance, from the Help -> Monitor Server Resources dialog. Its purpose is diagnostic: it tells you whether memory you can see being used is genuinely held, or simply not collected yet.

What it is for

The JVM collects garbage when it decides to, not when memory stops being needed. So "used memory" on a healthy system routinely climbs for a while and then drops, which means a rising memory figure on its own tells you nothing.

Run GC removes that ambiguity:

  • Used memory drops significantly. Nothing is wrong. You were looking at uncollected garbage.
  • Used memory barely moves. The memory is genuinely reachable. Something is holding references to it. That is the case where a Heap Dump is worth its cost, because it shows you what.

Do this before requesting a heap dump. It is instant, it is safe, and it frequently ends the investigation.

It is a request, not a command

Run GC calls System.gc(), which is a hint. The JVM is free to ignore it or to collect less than everything. If used memory does not move at all, treat the result as inconclusive rather than as proof of a leak, and repeat it once before concluding.

What it is not

Not a fix. If a channel is exhausting memory, running GC periodically treats the symptom and hides the cause. The cause is usually a script holding onto message content, an unbounded cache, or a large message being buffered rather than streamed. See Passing Through Large Files Without Loading Them Into Memory and Handling Large DICOM Images.

Not a tuning step. Regularly scheduled manual collections generally make throughput worse, not better. If memory pressure is constant, raise the heap or find what is consuming it.

Cost

Negligible, and safe to run on a production system. A collection may briefly pause application threads, but on the scale of a normal GC pause rather than anything a channel would notice.

In a cluster

The request is dispatched to the single instance selected in the dialog, so it reports on that node only.