1835251 Members
2467 Online
110078 Solutions
New Discussion

Memory occupation

 
Maurizio Fulli
Advisor

Memory occupation

Hi,
i've a Superdome partion with:
24Gb memory available
3 swap device with 8Gb setted each one
swap_mem_on=1
shmax=17Gb

The output of the swapinfo -tam command is list below:
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 8388608 0 8388608 0% 0 - 1 /dev/vg00/lvswap1
dev 8388608 0 8388608 0% 0 - 1 /dev/vg00/lvswap2
dev 8192000 0 8192000 0% 0 - 1 /dev/vg00/lvswap3
reserve - 12642076 -12642076
memory 19371168 3633000 15738168 19%
total 44340384 16275076 28065308 37% - 0 -

Now i've 74% of total memory busy, but if i run the "ps -efl" command and calcolate the SZ column for every process, the total is different to the 74% of memory occupation view throught the glance utility.

Which are the correct way to trace the memory occupation on the machine?
How can i find the list of the processes that are blocking the memory resources?

THKS A LOT
Best regards
Maurizio
5 REPLIES 5
A. Clay Stephenson
Acclaimed Contributor

Re: Memory occupation

Trying to calculate the memory usage associated with a process is very difficult (or at least difficult to turn into meaningful data). The reason is that much of the memory might be common to many processes. For example, a function in a shared library might be in use by 20 processes --- and many of these might be completely different executables. Do you count this once or 20 times? The same applies to shared memory segemnts. For multiple processes running the same executable (consider 10 vi's running at the same time), hopw do you total these. Each process gets unique data and bss segments but shares identical text segments. Glance does a good job of calculating total system usage but does suffer from the samed problem of how to "correctly" account for shared data and code. Ps and top know nothing about kernel data structures (e.g. buffer cache).
If it ain't broke, I can fix that.
Ninad_1
Honored Contributor

Re: Memory occupation

Maurizio,

What A. Clay Stephenson is saying is perfectly correct.
But one thing I thought might be of help to you is - since you want to know list of processes that are blocking the memory resources - use the following command

UNIX95= ps -e -o "pid,ruser,vsz,args" | sort -nr -k 3 | more


which will show you the top memory user processes. Also if you total the 3rd field ,which is vsz , comes approx same as the used memory show in glance.

Regs,
Ninad
Maurizio Fulli
Advisor

Re: Memory occupation

If i run the following command:
ps -e -o "pid,ruser,vsz,args" | sort -nr -k 3 | more
i've the same information displayed throught the ps -efl command.

The total memory pages on the hosts are 860680, and the size of a memory page is 4kb, so 860680*4= 3.4Gb that are very different to the 17Gb of memory occupation displayed on glance output.

What do you think about it???
A. Clay Stephenson
Acclaimed Contributor

Re: Memory occupation

Remember, ps doesn't know anything about kernel data structures so you are completely leaving out things like buffer cache and depending upon how you have buffer cache configured -- it alone could be a huge value. The good news is that you are not swapping so you are not under memory pressure. Since you already have memory = swap there is no point is enabling pseudoswap.
If it ain't broke, I can fix that.
Maurizio Fulli
Advisor

Re: Memory occupation

I've choose a weblogic process running on the host.
If i look on the weblogic console, i see 256 Mb allocated on this process.
If i look the same process pid on glance, this process on the RSS columns has been allocated 2,5Gb.

I don't know which data is correct or not.
The weblogic memory limit is set on 512Mb, how this process can allocate 2,5Gb?

Thanks a lot and regards.
Maurizio