Finding the most memory consuming processes in Linux
Platform: Oracle Linux 6.4
To find the most memory consuming processes, I tried the following 2 methods
1. Method1
Code:
# ps aux | head -1 ; ps aux | sort -nk +4 | tail -7
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 95 0.0 0.0 0 0 ? S Nov14 0:37 [ksoftirqd/22]
root 96 0.0 0.0 0 0 ? S Nov14 0:14 [watchdog/22]
root 97 0.0 0.0 0 0 ? S Nov14 0:00 [migration/23]
root 99 0.0 0.0 0 0 ? S Nov14 0:28 [ksoftirqd/23]
rpc 45927 0.0 0.0 19020 636 ? Ss Nov14 0:04 rpcbind
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 44842 0.3 0.1 5843388 376616 ? Sl Nov14 209:35 /grid/product/11.2.0/jdk/jre/bin/java ...
#
Method2. Using top command.
Execute top command, then type SHIFT + o and you'll get the following menu
Code:
Current Sort Field: K for window 1:Def
Select sort field via field letter, type any other key to return
a: PID = Process Id
b: PPID = Parent Process Pid
c: RUSER = Real user name
d: UID = User Id
e: USER = User Name
f: GROUP = Group Name
g: TTY = Controlling Tty
h: PR = Priority
i: NI = Nice value
j: P = Last used cpu (SMP)
* K: %CPU = CPU usage
l: TIME = CPU Time
m: TIME+ = CPU Time, hundredths
n: %MEM = Memory usage (RES)
o: VIRT = Virtual Image (kb)
p: SWAP = Swapped size (kb)
q: RES = Resident size (kb)
r: CODE = Code size (kb)
s: DATA = Data+Stack size (kb)
t: SHR = Shared Mem size (kb)
u: nFLT = Page Fault count
v: nDRT = Dirty Pages count
w: S = Process Status
x: COMMAND = Command name/line
y: WCHAN = Sleeping in Function
z: Flags = Task Flags <sched.h>
Now type n and enter.
I followed the above steps and I got the following output.
Hi ,
I am running a C/C++ program on a solaris 5.8 machine. This parituclar application has a module which saves data to a file. The module uses fwrite() function to save data.
The fwrite function write about 500 MB of data to a file. The problem which I am facing is, the memory consumtion... (2 Replies)
Dear all,
When I write the daemon programs it is consuming high memory and processor time. How can I avoid this?
But, the system daemons are not consuming more. How?
Can any one explain how the system daemons are handling the memory consumption and processor time.
Thanks,... (1 Reply)
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)
I had issues with processes locking up. This script checks for processes and kills them if they are older than a certain time.
Its uses some functions you'll need to define or remove, like slog() which I use for logging, and is_running() which checks if this script is already running so you can... (0 Replies)
Is there some way to tell what processes are attached to a shared memory segment? We have a system on which I perform "icps -ma" and there are several segments pending deletion having numerous processes attached to them and I can't tell what processes they are. Neither the creator's pid nor last... (7 Replies)
I m using following command to find top 10 cpu consuming processes.
However whenever i execute the command i get
following warning.
What can be done to avoid it?
# ps -auxf | sort -nr -k 3 | head -10
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.7/FAQ
root ... (6 Replies)
When I run 'top' command,I see the following
Memory: 32G real, 12G free, 96G swap free
Though it shows as 12G free,I am not able to account for processes that consume the rest 20G.
In my understanding some process should be consuming atleast 15-16 G but I am not able to find them.
Is... (1 Reply)
Hi All,
O/S: Linux 86x64 Red Hat
I have a sql script that queries top consuming processes of Linux using TOP commnd.
Now I need to automate this task and pass the top processes i.e., PID to the sql script through unix shell script.
Could anyone please let me know how to achieve this.
... (2 Replies)
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)