05-21-2017
There is no command that gives the “actual memory usage of a process” because there is no such thing as the actual memory usage of a process.
Each memory page of a process could be (among other distinctions):
1.Transient storage used by that process alone.
2.Shared with other processes using a variety of mechanisms.
3.Backed up by a disk file.
4.In physical memory or swap.
I think the “dirty” figure adds up everything that is in RAM (not swap) and not backed by a file. This includes both shared and non-shared memory (though in most cases other than forking servers, shared memory consists of memory-mapped files only).
The information displayed by pmap comes from /proc/PID/maps and /proc/PID/smaps. That is the real memory usage of the process — it can't be summarized by a single number.
Christian
Network Admin
Free SharePoint Hosting
Last edited by ChristianC123; 05-24-2017 at 04:19 PM..
10 More Discussions You Might Find Interesting
1. Programming
Hi all,
I tried to output memory usage information while the process is
executing at a particular time. I found out some people
suggesting calling the ioctl. I followed it and wrote a test example:
#include <unistd.h>
#include <stdlib.h>
#include <iostream.h>
#include <fcntl.h>
#include... (2 Replies)
Discussion started by: lanchen
2 Replies
2. UNIX for Advanced & Expert Users
we are running red hat ES4 and i would like to know if there is anyway of restrcting the maximum amount of memory that a process can get? I have a single preocess that is taking >13GB.
Thanks,
Frank (4 Replies)
Discussion started by: frankkahle
4 Replies
3. Shell Programming and Scripting
hi all,
i want to write a script that checks the memory usage of processes and send a mail with the name of the process witch is using more then 300mb RAM.
dose anybody have a sample script or an idea how i can make it ?
PROCCESSES="snmpd sendmail"
for myVar in $PROCCESSES
do
... (7 Replies)
Discussion started by: tafil
7 Replies
4. HP-UX
I use pstat API to get Process Infomation
I would like to get a process
1.process owner
2.how many physical memory and virtual memory and total memory used(KB) and usage(%)
3.a process excution file create time
4.a process excution file access time
I do't know which attribute it i need
... (3 Replies)
Discussion started by: alert0919
3 Replies
5. UNIX for Advanced & Expert Users
Hi Guys,
I work on a AIX environment and I'm trying to write a script where I can collect all the memory used by a process. Basically I'm executing the command 'ps -fu userid' to get all the process ids and then executing the 'ps v PID' to get all the memory allocated by PPID. My question is... (2 Replies)
Discussion started by: arizah
2 Replies
6. Linux
hello,
I have purchased VPS from one webhosting company. VPS comes with Virtuozzo power panel. It has 512MB gurranted RAM and dynamic RAM 2048 MB.
I have hosted single domain with 50MB database and wordpress installation.
But I am getting resource alerts. It goes sometime in yellow... (8 Replies)
Discussion started by: mrugesh78
8 Replies
7. AIX
Hi all,
I am currently having trouble to get nmon to print me the actual CPU usage for an interval for a process.
According to the manual, something like
# time nmon -t -C cron -s 5 -c 2 -F outfile
real 0m0.98s
user 0m0.03s
sys 0m0.04s
should print out at least the process... (15 Replies)
Discussion started by: zaxxon
15 Replies
8. Solaris
Hello Friends,
I need to check memory usage & availability before I could run a program if there is enough memory is left or not, so how could i achieve this? Which command output i should rely on? I have diplayed outputs of SAR, VMstat and PRstat commands below, But how could i check memory... (8 Replies)
Discussion started by: EAGL€
8 Replies
9. Solaris
hi all gurus:
I want to find out Solaris process memory usage, but got a bit confused, see if any one can provide me some guidance.
i tend to use prstat -a to get total memory consumption by user (I know prstat likely have a bug that simply sum up the memory, regardless if the memory being... (5 Replies)
Discussion started by: oakville
5 Replies
10. Solaris
I have multiple oracle databases on one server. All the database are running from the same user i.e. oraent.
The process for each database can be distinguished by the ps -ef command
Eg : ps -ef | grep oraentThe Output :
oraent 5361 1 0 20:58:05 ? 0:00 oracledb1... (11 Replies)
Discussion started by: yashreads
11 Replies
LEARN ABOUT DEBIAN
memstat
MEMSTAT(1) Linux Programmer's Manual MEMSTAT(1)
NAME
memstat - Identify what's using up virtual memory.
SYNOPSIS
memstat [-w][-p PID]
DESCRIPTION
memstat lists all accessible processes, executables, and shared libraries that are using up virtual memory. To get a complete list memstat
has to be run as root to be able to access the data of all running processes.
First, the processes are listed. An amount of memory is shown along with a process ID and the name of the executable which the process is
running. The amount of memory shown does not include shared memory: it only includes memory which is private to that process. So, if a
process is using a shared library like libc, the memory used to hold that library is not included. The memory used to hold the exe-
cutable's text-segment is also not included, since that too is shareable.
After the processes, the shared objects are listed. The amount of memory is shown along with the filename of the shared object, followed
by a list of the processes using the shared object. The memory is listed as the total amount of memory allocated to this object throughout
the whole namespace. In brackets also the amount that is really shared is listed.
Finally, a grand total is shown. Note that this program shows the amount of virtual (not real) memory used by the various items.
memstat gets its input from the /proc filesystem. This must be compiled into your kernel and mounted for memstat to work. The pathnames
shown next to the shared objects are determined by scanning the disk. memstat uses a configuration file, /etc/memstat.conf, to determine
which directories to scan. This file should include all the major bin and lib directories in your system, as well as the /dev directory.
If you run an executable which is not in one of these directories, it will be listed by memstat as ``[0dev]:<inode>''.
Options
The -w switch causes a wide printout: lines are not truncated at 80 columns.
The -p switch causes memstat to only print data gathered from looking at the process with the gicen PID.
NOTES
These reports are intended to help identify programs that are using an excessive amount of memory, and to reduce overall memory waste.
FILES
/etc/memstat.conf
/proc/*/maps
SEE ALSO
ps(1), top(1), free(1), vmstat(8), lsof(8), /usr/share/doc/memstat/memstat-tutorial.txt.gz
BUGS
memstat ignores all devices that just map main memory, though this may cause memstat to ignore some memory usage.
Memory used by the kernel itself is not listed.
AUTHOR
Originally written by Joshua Yelon <jyelon@uiuc.edu> and patched by Bernd Eckenfels <ecki@debian.org>. Taken over and rewritten by Michael
Meskes <meskes@debian.org>.
Debian 01 November 1998 MEMSTAT(1)