I have an application deployed to production which sometimes throws OutOfMemory
exception due to some memory leak. It is running on a headless ubuntu box on which I would prefer not to connect visualvm, jconsole etc remotely. Is there a way to make the jvm
do gc (like in visualvm where you just click a button to do it).
I would like to run jmap -histo:live <pid>
and this gc commands alternatively to find out which objects are surviving a gc. Which object numbers are growing etc. Right now I can see some unexpected object counts but it is happening across a number of my domain objects so I am not sure if it is a delayed gc or a memory leak.
So in short, I am looking for the linux command to be run against a jvm
pid to cause it to do gc. Not system.gc.