Operating System - HP-UX
1832997 Members
2387 Online
110048 Solutions
New Discussion

Re: How to find out which process consuming the memory?

 
SOLVED
Go to solution
faust2004
Regular Advisor

How to find out which process consuming the memory?

Hi, experts,

the free memory is near zero !
How to find out which process consuming the
memory on n4000(11.0), just like ps -o pmem on dec box.

Thanks
SUnny
8 REPLIES 8
steven Burgess_2
Honored Contributor
Solution

Re: How to find out which process consuming the memory?

Hi

The following (thanks to Bill Hassell) uses the POSIX (UNIX95) options of the 'ps' command to assist in this tracking, and ranking the 'ps' output in descending kilobyte core size. A space character follows the 'UNIX95' variable declaration and the 'ps' command begins without any interceding delimiter. This sets UNIX95 only for the one command line.

# UNIX95= ps -e -o "user,vsz,pid,ppid,args" | sort -rnk2 | more

Do a search on memory usage - there are hundreds of threads regarding this, including the quote above from JRF

Hope this helps ,

Steve
take your time and think things through
Michael Tully
Honored Contributor

Re: How to find out which process consuming the memory?

Hi,

Try this:

# UNIX95= ps -eo 'vsz args' | sort -nr | more

What is you buffer cache size? If it is over 300Mb this could a problem with no free memory being available.

# vmstat -n (check for pageouts)
# swapinfo -tm (check swap usage)

Use glance to view the online monitor

Michael
Anyone for a Mutiny ?
faust2004
Regular Advisor

Re: How to find out which process consuming the memory?

Steven, thanks a lot,

what is the connection of the vsize memory and physical memory?


Thanks
Sunny
steven Burgess_2
Honored Contributor

Re: How to find out which process consuming the memory?

Hi

RSZ = Resident set size
VSZ = Virtual set size

RSZ is a subset of VSZ - the portion of the processes memory which is 'resident'
in physical memory (ie not paged out). VSZ is the total size, including resident
and non-resident pages.

These values are totals, obtained by adding up the memory utilisation of the
processes various memory segments (of which there can be lots).

Hope this helps

Steve
take your time and think things through
steven Burgess_2
Honored Contributor

Re: How to find out which process consuming the memory?

Hi

Here's is a script to calculate free memory

Have attached a doc which goes further into memory management

Who is your top user ?

#!/usr/bin/sh

let x=$(grep -i physical: /var/adm/syslog/syslog.log|head -1|awk '{print $7}')/1048
let z=$(vmstat|tail -1|awk '{print $5}')*4096;let z=$z/1000000
let free=100000/$x*$z
let free=$free/1000
let free=100-$free
echo "$x Mb physical memory \n$z Mb memory free \n$free % used"

Regards

Steve
take your time and think things through
faust2004
Regular Advisor

Re: How to find out which process consuming the memory?

How to find out buffer cache and res size of memory?

Thanks
Sunny
Michael Tully
Honored Contributor

Re: How to find out which process consuming the memory?

Hi Sunny,

If you have glance installed it is really easy
as it reports a number of items and shows the
actual usage on the screen.


# /opt/perf/bin/glance
F5 next keys
F3 SysTables
Page Down - This will show you the minimum
the maximum and current usage. The below
will extract the current levels from the
kernel. Don't forget that these values are percentages.

# kmtune -q dbc_min_pct
Parameter Current Dyn Planned Module Version
===============================================================================
dbc_min_pct 2 - 2

# kmtune -q dbc_max_pct
Parameter Current Dyn Planned Module Version
===============================================================================
dbc_max_pct 7 - 7

# kmtune -q dbc_min_pct
Parameter Current Dyn Planned Module Version
===============================================================================
dbc_min_pct 2 - 2

Here is an explanation further on RSZ/VSZ

RSZ = Resident set size
VSZ = Virtual set size

RSZ is a subset of VSZ - the portion of the processes memory which is 'resident' in physical memory (ie not paged out). VSZ is the total size, including resident and non-resident pages.

These values are totals, obtained by adding up the memory utilisation of the processes various memory segments (of which there can be lots). Its not uncommon for glance and ps to report slightly different results. For more detail get glance to give you a memory report for that process - you will then see a list of all the processes memory segments.

There is also a white paper on your unix system that also provides some valuable information.

/usr/share/doc/mem_mgt.txt

HTH
~Michael~
Anyone for a Mutiny ?
faust2004
Regular Advisor

Re: How to find out which process consuming the memory?

I found the serveral startup and shutdown
oracle server comsuming too much share memory.
I have to reboot the server to release them
. it is possable to found out which share memory is used now by oracle background process?
gz97a:/ys# ipcs -mob
IPC status from /dev/kmem as of Mon Jun 3 13:44:34 2002
T ID KEY MODE OWNER GROUP NATTCH SEGSZ
Shared Memory:
m 0 0x411c1887 --rw-rw-rw- root root 0 348
m 1 0x4e0c0002 --rw-rw-rw- root root 2 31040
m 2 0x412062b0 --rw-rw-rw- root root 2 8192
m 515 0x00000000 D-rw-r----- oracle oinstall 4 3148218368
m 4 0x06347849 --rw-rw-rw- root sys 0 77384
m 9733 0x00000000 D-rw-r----- oracle oinstall 5 3148218368
m 6 0xd51fb72c --rw-r----- oracle oinstall 799 3148218368
m 6663 0x0c6629c9 --rw-r----- root sys 2 13031736


Sunny
Thanks