I am a newbie to linux. I am trying to find a command that displays
pid and java class.
I tried:
ps -C java -o pid
but it only showed me pid, not java classes.
So I used a different command:
ps -ef | grep java"
It showed me a full library of JAR files and associated java classes. However, I don’t need all of that information, I need only to display pid and java class.
The problem that I am facing is that sometimes the java processes take like 100M of memory and I can only know the pid with the command java on it by using linux command:
top
But it couldn’t find which java program is the one responsible for this. It will help me to debug that java file for memory leak.
try this command and you can list of java process.
[or]
JPS will be helpful
JPS,JSTAT,JMAP,JSTACK,JHAT
you can run jps command it will show the pid value and based on these pid value others command will be executed.