Sponsored Content
Homework and Emergencies Emergency UNIX and Linux Support CPU and memory utilization of a process, by process name Post 302685421 by lee.wang on Monday 13th of August 2012 12:44:34 AM
Old 08-13-2012
you can use nmon..
 

10 More Discussions You Might Find Interesting

1. AIX

cpu utilization of a process

Hi, How can i find out the average cpu utilization of a particular long-running process in AIX? is there some command for this Thanks (2 Replies)
Discussion started by: iam
2 Replies

2. Shell Programming and Scripting

Memory and CPU utilization process

Hi, I need to check which process in linux is taking high memory and which process is taking high cpu usage. Regards, Bash (4 Replies)
Discussion started by: learnbash
4 Replies

3. UNIX for Dummies Questions & Answers

how to get persistant cpu utilization values per process per cpu in linux (! top,ps)

hi, i want to know cpu utilizatiion per process per cpu..for single processor also if multicore in linux ..to use these values in shell script to kill processes exceeding cpu utilization.ps (pcpu) command does not give exact values..top does not give persistant values..psstat,vmstat..does njot... (3 Replies)
Discussion started by: pankajd
3 Replies

4. UNIX for Dummies Questions & Answers

Getting CPU utilization and memory for a process

I am trying to get cpu util and memory occupied for a process. I use these (I am showing output also): using top ---------- $ top p 25272 d 5 top - 01:52:17 up 2 days, 21:28, 2 users, load average: 0.02, 0.05, 0.06 Tasks: 1 total, 0 running, 1 sleeping, 0 stopped, 0 zombie... (5 Replies)
Discussion started by: radiatejava
5 Replies

5. AIX

High CPU utilization by a pro*C process

Hi , we upgarded our AIX from 5.3 to 6.1 and upgraded our xlc compiler from ver 6.0 to 9.0 . After this upgrade one of our pro*C program is utilizing around 20% of the CPU. Before upgarde its using only 0.2 %. when i try to debug using the truss command i got the below error. $... (6 Replies)
Discussion started by: mugunthanvh
6 Replies

6. UNIX for Dummies Questions & Answers

Get CPU,Memory utilization by process id

Hi , We need to get the CPU% and Memory utilization of process by process id. Is there any way to do get them ? I tried few commands like top -p <PID> , but am getting error "Quitting top: pset <PID> doesn't exist" also i tried with ps -eo option but am getting error "ps: illegal option --... (1 Reply)
Discussion started by: suresh_g
1 Replies

7. HP-UX

Get CPU,Memory utilization by process id

Hi , We need to get the CPU% and Memory utilization of process by process id. Is there any way to do get them ? I tried few commands like top -p <PID> , but am getting error "Quitting top: pset <PID> doesn't exist" also i tried with ps -eo option but am getting error "ps: illegal option --... (5 Replies)
Discussion started by: suresh_g
5 Replies

8. AIX

Checking CPU utilization by db2sysc process

Hi, I am trying to write a script which will fire alert mail to dba ( db2dba) when there process will utilize CPU more than 90%. But I am unable to do so. I am using following command to calucate CPU utilization be db2sysc process : ps -eo pcpu,pid,comm | grep -i db2sysc | awk '{ SUM+=$1;... (0 Replies)
Discussion started by: niteshtheone
0 Replies

9. Shell Programming and Scripting

Checking CPU utilization by db2sysc process

Hi, I am trying to write a script which will fire alert mail to dba ( db2dba) when there process will utilize CPU more than 90%. But I am unable to do so. I am using following command to calucate CPU utilization be db2sysc process : ps -eo pcpu,pid,comm | grep -i db2sysc | awk '{ SUM+=$1;... (6 Replies)
Discussion started by: niteshtheone
6 Replies

10. Solaris

[DOUBT] Memory high in idle process on Solaris 10 (Memory Utilization > 90%)

Hi Experts, Our servers running Solaris 10 with SAP Application. The memory utilization always >90%, but the process on SAP is too less even nothing. Why memory utilization on solaris always looks high? I have statement about memory on solaris, is this true: Memory in solaris is used for... (4 Replies)
Discussion started by: edydsuranta
4 Replies
GETRLIMIT(2)						      BSD System Calls Manual						      GETRLIMIT(2)

NAME
getrlimit, setrlimit -- control maximum system resource consumption LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <sys/resource.h> int getrlimit(int resource, struct rlimit *rlp); int setrlimit(int resource, const struct rlimit *rlp); DESCRIPTION
Limits on the consumption of system resources by the current process and each process it creates may be obtained with the getrlimit() call, and set with the setrlimit() call. Resources of an arbitrary process can be obtained/changed using sysctl(3). The resource parameter is one of the following: RLIMIT_AS The maximum amount (in bytes) of virtual memory the process is allowed to map. RLIMIT_CORE The largest size (in bytes) core file that may be created. RLIMIT_CPU The maximum amount of CPU time (in seconds) to be used by each process. RLIMIT_DATA The maximum size (in bytes) of the data segment for a process; this defines how far a program may extend its break with the sbrk(2) system call. RLIMIT_FSIZE The largest size (in bytes) file that may be created. RLIMIT_MEMLOCK The maximum size (in bytes) which a process may lock into memory using the mlock(2) function. RLIMIT_NOFILE The maximum number of open files for this process. RLIMIT_NPROC The maximum number of simultaneous processes for this user id. RLIMIT_RSS The maximum size (in bytes) to which a process's resident set size may grow. This imposes a limit on the amount of physical memory to be given to a process; if memory is tight, the system will prefer to take memory from processes that are exceeding their declared resident set size. RLIMIT_SBSIZE The maximum size (in bytes) of the socket buffers set by the setsockopt(2) SO_RCVBUF and SO_SNDBUF options. RLIMIT_STACK The maximum size (in bytes) of the stack segment for a process; this defines how far a program's stack segment may be extended. Stack extension is performed automatically by the system. A resource limit is specified as a soft limit and a hard limit. When a soft limit is exceeded a process may receive a signal (for example, if the CPU time or file size is exceeded), but it will be allowed to continue execution until it reaches the hard limit (or modifies its resource limit). The rlimit structure is used to specify the hard and soft limits on a resource, struct rlimit { rlim_t rlim_cur; /* current (soft) limit */ rlim_t rlim_max; /* hard limit */ }; Only the super-user may raise the maximum limits. Other users may only alter rlim_cur within the range from 0 to rlim_max or (irreversibly) lower rlim_max. An ``infinite'' value for a limit is defined as RLIM_INFINITY. Because this information is stored in the per-process information, this system call must be executed directly by the shell if it is to affect all future processes created by the shell. Thus, shells provide built-in commands to change the limits (limit for csh(1), or ulimit for sh(1)). The system refuses to extend the data or stack space when the limits would be exceeded in the normal way: a brk(2) call fails if the data space limit is reached. When the stack limit is reached, the process receives a segmentation fault (SIGSEGV); if this signal is not caught by a handler using the signal stack, this signal will kill the process. A file I/O operation that would create a file larger that the process' soft limit will cause the write to fail and a signal SIGXFSZ to be generated; this normally terminates the process, but may be caught. When the soft CPU time limit is exceeded, a signal SIGXCPU is sent to the offending process. RETURN VALUES
A 0 return value indicates that the call succeeded, changing or returning the resource limit. Otherwise, -1 is returned and the global vari- able errno is set to indicate the error. ERRORS
The getrlimit() and setrlimit() will fail if: [EFAULT] The address specified for rlp is invalid. [EINVAL] Specified resource was invalid; or, in the setrlimit() call, the specified rlim_cur exceeds the specified rlim_max. [EPERM] The limit specified to setrlimit() would have raised the maximum limit value, and the caller is not the super-user. The setrlimit() function may fail if: [EINVAL] The limit specified to setrlimit() cannot be lowered, because current usage is already higher than the limit. SEE ALSO
csh(1), sh(1), mlock(2), setsockopt(2), sigaction(2), sigaltstack(2), libquota(3), sysctl(3) HISTORY
The getrlimit() function call appeared in 4.2BSD. BUGS
The resource limit RLIMIT_RSS is not implemented in uvm(9) which means that process memory size limits are not enforced. BSD
November 15, 2011 BSD
All times are GMT -4. The time now is 03:58 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy