Login or Register to Ask a Question and Join Our Community

How ti kill a process which is consuming so much time

Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How ti kill a process which is consuming so much time
# 1  
Old 04-04-2006
Java How ti kill a process which is consuming so much time

There is a process which is consuming too much time.. how to find that process and kill it.
# 2  
Old 04-04-2006
use ps -ef|grep program_name to get the pid of process.
then use kill command.

syntax is
kill pid1 pid2 ....
# 3  
Old 04-04-2006
for i in `ps -eaf | grep "programname" | tr -s " " | cut -f2 -d " "`
kill -9 ${i}

ps -eaf | grep "programname" | tr -s " " | cut -f2 -d " " --- This should return all process ids.
# 4  
Old 04-04-2006

First, make sure that process does consume too much of CPU by using “top” command. Second, make sure (as far as it is possible) that process is independent; it means that it has no parent process that will relaunch it again by “pstree” command or by following the parent process from “ps -ef” or “ps -aux” (depending on UNIX clone).
As you decided to kill process try first not to use “-9” because much of junk will remain in memory and it may make “zombie” from other processes that may depend on this one. Better use SIGSTOP signal. In Linux SIGSTOP is number 19 so “kill -19 PID”, you can check what it is in your system by “kill -l” command , it will print the complete list of signals your UNIX can handle. With SIGSTOP, the process will stop gracefully as system has requested it to be stopped. You can use “-9” in a case the process is broken, its structures are corrupted and it does not response to the signals. “-9” option will remove process brutally with no concerns of data it possibly may have in memory or child processes it may have. Take “UNIX Essentials and UNIX Core” DVD if you have questions like that.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Which process was consuming most memory in the Past?

Hello There are options / commands to check which process is consuming maximum memory However is there any command/mechanism which will tell us which process was consuming maximum memory in specific time interval in the past? I heard nmon report can help in this regard. is there any... (5 Replies)
Discussion started by: Chetanz
5 Replies

2. Shell Programming and Scripting

Help with kill a specific process after certain running time

Hi, Do anybody experience to write a bash script in order to kill a specific process (java) after certain time of running? eg. java java.jar task_run.txt I will run a java program (java.jar) which will run a long list of process (task_run.txt) one by one. I plan to terminate the java... (5 Replies)
Discussion started by: perl_beginner
5 Replies

3. UNIX for Advanced & Expert Users

Kill a process after a certain amount of time

I would like to kill a process after a certain amount of time. Can I please get some ideas on how to do this? (9 Replies)
Discussion started by: cokedude
9 Replies

4. AIX

Process ids consuming huge resources ?

Hi All what is the command to check process ids , which are running from long time and which are consuming more cpu? Also how to check, what a particular PID is running what For Ex: i have a pid :3223722 which is running since from long time, if i want to check what is this... (1 Reply)
Discussion started by: sidharthmellam
1 Replies

5. Shell Programming and Scripting

Time-consuming simple script

Hi, I need some simple but time-consuming script, I would like to compare run time in different shells. I thought about factorial or exponentiation in many loop, but I don't know it's a good idea. Do you know some simple, time-consuming (arithmetic) script ?? I would be thankful for every... (8 Replies)
Discussion started by: Physix
8 Replies

6. Solaris

Help to trace process consuming more space

Hi all, We have a server having much processes running. It is very difficuilt to trace the exact consuming more memory. Howerver, it shows CPU usage in sequence but how memory? Tried working with TOP command. Please let me know if something not clear. Thanks, Deepak (5 Replies)
Discussion started by: naw_deepak
5 Replies

7. AIX

Command to find TOP 5 Memory consuming process

HI All, Can anyone send me a command to find TOP 5 Memory consuming process. It would be lelpful if I get output something like below processname - pid - memory(in MB) - command I tried few commands from the internet but the result only give the real memory usage or pagging, I want total... (4 Replies)
Discussion started by: bce_groups
4 Replies

8. HP-UX

which thread is consuming much time ?

Hi How do i check which thread is consuming much time ? In my process it is tacking much %CPU so i want to check whick thread tacking much time? Any suggestion highly appriciated. I am using HP-UX B.11.31 U ia64 Regards, Ashok (5 Replies)
Discussion started by: ashokd001
5 Replies

9. Programming

kill a process which run out of time

hello everybody!! i want ur help! it is urgent!! ... pid=fork(); if(pid==0) { execl(a program); exit(1);} else if (pid>0) { timer(5); //(command 1)timer is a function that count up to 5sec if(kill(pid,0)==0)kill(pid,9);//(command 2) wait(&status); .... } else perror("error");... (3 Replies)
Discussion started by: nicos
3 Replies

10. AIX

Process consuming most memory

How can i find the processes that is consuming most memory? I tried TOPAS and SVMON and this didn't gave me the desired result. (1 Reply)
Discussion started by: shabu
1 Replies
Login or Register to Ask a Question

Featured Tech Videos