Which VM PID?

Which VM PID?

They say you can't teach an old dog new tricks, and to a large degree they are right. But that doesn't mean you stop trying.

I was looking for a particular Java VM on my system that I wanted to kill, a runaway java testcase. In the past I would have used my trustworthy 'kill_java' tcsh alias which did:


kill -9 `ps -jU ${USER} | fgrep 'java' | sed -e "s/\^[\\ ]\*\\([0-9][0-9]\*\\).\*/\\1/"`

Unfortunately I have quite a few Java webstart applications running on this machine, and the 'kill_java' alias wasn't a good idea. After a few experiments with 'ps' it dawned on me that I was an old dog, and had forgotten all about the new JDK utility 'jps'. I tried running 'jps', then eventually:


jps -m -l

Low and behold, I found the exact PID that needed to be killed, simple and easy.

So don't forget 'jps'! It can be very handy.

Comments:

Post a Comment:
Comments are closed for this entry.
About

Various blogs on JDK development procedures, including building, build infrastructure, testing, and source maintenance.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today