I logged onto my server this morning and it was running incredibly slow. I had no idea wtf was causing the problem so I executed top and sorted by memory. I found this:
So, how can I killl all process that are executing Java?Code:7298 customa 18 0 492M 492M 3768 S 0.0 12.3 0:08 1 java 7300 customa 15 0 492M 492M 3768 S 0.0 12.3 1:58 2 java 7301 customa 15 0 492M 492M 3768 S 0.0 12.3 1:58 7 java 7302 customa 15 0 492M 492M 3768 S 0.0 12.3 1:58 5 java 7303 customa 15 0 492M 492M 3768 S 0.0 12.3 1:58 1 java 7304 customa 16 0 492M 492M 3768 S 0.0 12.3 1:57 6 java 7305 customa 15 0 492M 492M 3768 S 0.0 12.3 1:58 3 java 7306 customa 16 0 492M 492M 3768 S 0.0 12.3 1:58 4 java 7307 customa 16 0 492M 492M 3768 S 0.0 12.3 1:58 3 java 7308 customa 15 0 492M 492M 3768 S 0.0 12.3 15:59 5 java 7309 customa 15 0 492M 492M 3768 S 0.0 12.3 0:07 4 java 7310 customa 15 0 492M 492M 3768 S 0.0 12.3 0:10 6 java 7311 customa 25 0 492M 492M 3768 S 0.0 12.3 0:00 4 java 7312 customa 15 0 492M 492M 3768 S 0.0 12.3 0:00 3 java 7313 customa 15 0 492M 492M 3768 S 0.0 12.3 0:32 7 java 7314 customa 16 0 492M 492M 3768 S 0.0 12.3 0:38 6 java 7315 customa 25 0 492M 492M 3768 S 0.0 12.3 0:00 4 java 7316 customa 15 0 492M 492M 3768 S 0.0 12.3 11:11 0 java 7320 customa 25 0 492M 492M 3768 S 0.0 12.3 0:00 0 java 7578 customa 15 0 492M 492M 3768 S 0.0 12.3 1:00 4 java 7585 customa 15 0 492M 492M 3768 S 0.0 12.3 2:19 5 java 7586 customa 15 0 492M 492M 3768 S 0.0 12.3 2:11 1 java 7587 customa 15 0 492M 492M 3768 S 0.0 12.3 2:21 3 java 7588 customa 15 0 492M 492M 3768 S 0.0 12.3 2:16 3 java 7589 customa 15 0 492M 492M 3768 S 0.0 12.3 2:10 2 java 7590 customa 15 0 492M 492M 3768 S 0.0 12.3 2:13 6 java 7591 customa 15 0 492M 492M 3768 S 0.0 12.3 2:12 4 java 7592 customa 15 0 492M 492M 3768 S 0.0 12.3 2:13 0 java 7593 customa 15 0 492M 492M 3768 S 0.0 12.3 2:19 0 java 7594 customa 15 0 492M 492M 3768 S 0.0 12.3 2:14 4 java 7595 customa 15 0 492M 492M 3768 S 0.0 12.3 49:32 5 java 7599 customa 15 0 492M 492M 3768 S 0.0 12.3 1:03 3 java 7603 customa 15 0 492M 492M 3768 S 0.0 12.3 1:00 4 java 7608 customa 15 0 492M 492M 3768 S 0.0 12.3 0:00 2 java
Hello
try
killall -v java
When I look at the killall command I see: -v,--verbose report if the signal was successfully sent
Not sure how killall -v java would help him in this case.
yes you are right , sorry for this mistake
i recheck & almost nothing kill process by name
I don't think there is a default method to kill by name. You could write a shell script to do it though.
in additional you can try to kill with "-12" this will try to shutdown proper the application
I normally do 'ps aux' and 'kill -9' the PID
Code:#ps aux USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
Last edited by Roger; 06-27-2010 at 07:17 PM.
Be sure to read the updated FAQ || Health is achieved through 10,000 different steps.
A textual description can be only part of your question, be sure to provide sample results, errors and your platform in the appropriate forums while asking.
This is already answered by the guy above me, but you should know about 'pkill', it kills a process by name. I think you can also use regexp in the name, too.
Check the manpages for it.
Code:example: pkill -9 java;
kill -9 $(ps -e |grep "httpd" | awk '{print $1;}')
or
killall -9 httpd
assuming httpd is the service you wanna kill.
Checkout my new forum! http://adminreference.com/
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks