1839217 Members
3256 Online
110137 Solutions
New Discussion

Actual Memory usage

 
Shermaine
Occasional Advisor

Actual Memory usage

How to determine the memory usage.
For eg: By using top, the memory shown was size: 384K res:544K while using ps -elf of the PID, it returns 94.
Can advise on how to determine the actual memory usage.
And also with the top command, what is the diff between size and res? thanks
14 REPLIES 14
Joseph Loo
Honored Contributor

Re: Actual Memory usage

hi,

use vmstat and swapinfo command.

# vmstat 5 20
where free column is in pages (about 4kb) and the number is 5 seconds for 20 intervals

# swapinfo -tam

regards.
what you do not see does not mean you should not believe
Bharat Katkar
Honored Contributor

Re: Actual Memory usage

#swapinfo -t

this will show you total swap space configured and physical memory in your system.

See the attached file. Here i have 2 GB ram and 5 GB swap.
Total it shows 7 GB.

That is what you want!!!


You need to know a lot to actually know how little you know
twang
Honored Contributor

Re: Actual Memory usage

vmstat 5 5
Check the free mem column. Unit is page. One buffer page is 4096k.
Shermaine
Occasional Advisor

Re: Actual Memory usage

Thanks.. can anyone tell me what is size and what it res from running the command "top"? ans what is the unit?
Joseph Loo
Honored Contributor

Re: Actual Memory usage

hi,

SIZE = Total virtual size of the process in kilobytes.

RES = Resident size of the process in kilobytes.

refer to "man top" for more details about the other columns.

regards.
(p.s. some points for the efforts)
what you do not see does not mean you should not believe
Shermaine
Occasional Advisor

Re: Actual Memory usage

and can also advise on the unit of the memory when using the command ps -elf
Joseph Loo
Honored Contributor

Re: Actual Memory usage

look at the SZ column (actual memory usage in pages) if you are interested in the memory usage. for the VSZ (virtual memory usage in pages) column, use the UNIX95 variable and refer to this thread for details.

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=484774

regards.
(p.s. remember to assign points for earlier posts as well. read this:
http://forums1.itrc.hp.com/service/forums/helptips.do?#28 )
what you do not see does not mean you should not believe
Joseph Loo
Honored Contributor

Re: Actual Memory usage

you r just being a typical singaporean, if you know what i mean.
what you do not see does not mean you should not believe
Bill Hassell
Honored Contributor

Re: Actual Memory usage

ps -elf is reporting memory in pages, not kilobytes. A memory page is 4k so sz=94 is really 385,024 bytes, pretty close to the 384k reported by top. NOTE: memory usage by a program is a rather complex subject if you include shared memory, shared text, and shared libraries. RSS is the resident set size (actually in memory) and VSS is the virtual set size which includes space that may be mapped in the swap area.

As mentioned, you may want to look VSZ value in ps by temporarily enabling the UNIX95 variable as in:

UNIX95= ps -p 1234 -o vsz,pid,ppid,ruser,args

The first number VSZ is in kilobytes.


Bill Hassell, sysadmin
Shermaine
Occasional Advisor

Re: Actual Memory usage

Joseph LOO and you are not been professional on posting that msg! If you can read bet the lines too... But still thanks for your help anyway, hopefully you are not just after the points only!
Joseph Loo
Honored Contributor

Re: Actual Memory usage

hi,

obviously, you have not read the help tips I send about assigning points:

please especially read the last paragraph:

==========================
How many points should I assign to replies?

Every response to your question is eligible to earn between 1-10 points. No need to worry about running out of points - when a truly awesome reply rolls in that deserves a 10, you will be able to assign it a 10! However, be careful to assign points based on the value that a reply truly provides. Use the following scale as a guideline:


o N/A: The answer was simply a point of clarification to my original question

o 1-3: The answer didn't really help answer my question, but thanks for your assistance!

o 4- 7: The answer helped with a portion of my question, but I still need some additional help!

o 8-10: The answer has solved my problem completely! Now I'm a happy camper!


Although assigning points is not mandatory, it is a key component of a strong, interactive community, and it is STRONGLY ENCOURAGED. Others have taken time to help you, so please take a moment to give them credit for their assistance!
===========================

Yes, I am doing it for the points, I will be lying if I am telling you I am not. I am also doing it for the thrill of a challenge, giving a right answer and feeling "appreciated" by those who awards the points as it should be.


regards.
(p.s. till we meet again, this will be my last post to this thread.)
what you do not see does not mean you should not believe
Tom Dineen_2
Advisor

Re: Actual Memory usage

I use: ps -l option and like to use glance command not gpm command.

you can see the RSS/VSS sizes in glance.
Flavio Remo Rossi
Occasional Contributor

Re: Actual Memory usage

This is to clarify my ideas.
Bharat Katkar at May 11, 2004 09:05:07 wrote
#swapinfo -t

this will show you total swap space configured and physical memory in your system.

I understand that the output contains one line "memory" that is the pseudo-swap and not physical memory. Is it right or not ?
Bharat Katkar
Honored Contributor

Re: Actual Memory usage

Rossi wrote on May 12, 2004:
I understand that the output contains one line "memory" that is the pseudo-swap and not physical memory. Is it right or not ?

Right!! Thanks for clearing your and my ideas as well. It seems i need to rest for sometime now.
You are correct sir.

Regards,
Bharat
You need to know a lot to actually know how little you know