I need to identify long running process and save pid of that process to a file. With the below command I am able to identify age of long running process. But after this I am struck with how to grep PID of that long running process?
I usually run few Java applications, one for server running locally and other for some IDE like NetBeans. And from time to time, after lots of redeployments, my server get stuck on OutOfMemoryException so I need to kill Java process in order to reboot.
So I do pkill -9 java but this also kills my running IDE which I don't want to.
We had java processes(cassandra service) running with jdk 1.6 in our linux machine and we did upgrade the JDK in the machine from 1.6 to 1.7 using rpm package without stopping the process (/usr/bin/jdk1.6/bin/java) which were running with earlier version of java.