The Asylum Private Messages Options Search Blogs Images Chat Cam Portals Calendar FAQ's Join  
Asylum Forums : Powered by vBulletin version 2.2.8 Asylum Forums > WIT - Whore Institute of Technology > Process Memory Usage and Linux
  Last Thread   Next Thread
Author
Thread [new thread]    [post reply]
amerikanjunkie
various one

Registered: Aug 2000
Location:
Posts: 1731

Process Memory Usage and Linux

Process Memory Usage and Linux
February 6th, 2006 by cvcrud
http://cvcrud.jedicoder.net

Some of you may have recently read an article on Slashdot detailing why TOP and PS present flase values. If you didnt, that is ok, because I am going to sum it up for you here, keeping in tune with the previous post about linux performance.

Alot of you may know that TOP and PS arent the greatest reporting tools for memory and cpu usage. But why are they not good reporting tools? Because when a program is ran, it accesses various parts of many shared libraries used by other programs. This library is only loaded ONCE into memory to be accessed by various processes. However, when you run TOP or PS, it adds the size of the shared library to the memory total for each process that accesses it. So if you have 6 processes, all accessing lib*.so.5, it will add the size of lib*.so.5 six times, even though it is only actually being loaded into memory once. That is reported to TOP and PS, thus giving you false results.

Lets take firefox for example, when I do a “ps aux | grep firefox-bin”, I get the following:

USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
73160 5876 2.5 4.8 133296 50616 ? Sl 08:36 2:04 /usr/lib/firefox/firefox-bin

It shows that Virtual memory being used is 133 Megs (Virtual Memory = Resident + SWAP), the Resident memory usage is 50 megs. Now lets do a: pmap -d 5876 —- the PID of firefox-bin…..

[root@blah ~]# pmap -d 5876 | grep mapped
mapped: 133316K writeable/private: 95916K shared: 1716K

The writeable/private gives you the “incremental cost” of running the process “factoring out the shared libraries”. Firefox-bin is actually accessing/using about 95 Megs, versus 133 Megs.

Report this post to a moderator | IP: Logged

Old Post 02-06-2006 05:41 PM
amerikanjunkie is offline Click Here to See the Profile for amerikanjunkie Click here to Send amerikanjunkie a Private Message Find more posts by amerikanjunkie Add amerikanjunkie to your buddy list [P] Edit/Delete Message Reply w/Quote
dogcow
brucoš

Registered: Apr 2005
Location: heat
Posts: 10749

thanks

__________________
Time is the fire in which we burn.

Report this post to a moderator | IP: Logged

Old Post 02-06-2006 05:48 PM
dogcow is offline Click Here to See the Profile for dogcow Click here to Send dogcow a Private Message Find more posts by dogcow Add dogcow to your buddy list [P] Edit/Delete Message Reply w/Quote
skalie
the honourable

Registered: Sep 2001
Location: ........
Posts: 15003

thanks

Report this post to a moderator | IP: Logged

Old Post 02-06-2006 06:06 PM
skalie is offline Click Here to See the Profile for skalie Click here to Send skalie a Private Message Find more posts by skalie Add skalie to your buddy list [P] Edit/Delete Message Reply w/Quote
SocialParasite
100% pure failtanium.

Registered: Jul 2000
Location: Beatrice, Nebraska
Posts: 18808

95 megs is still insane for something as simple as a browser.

__________________
The pinnacle of Failbot technology.

Report this post to a moderator | IP: Logged

Old Post 02-07-2006 09:46 PM
SocialParasite is offline Click Here to See the Profile for SocialParasite Click here to Send SocialParasite a Private Message Visit SocialParasite's homepage! Find more posts by SocialParasite Add SocialParasite to your buddy list [P] Edit/Delete Message Reply w/Quote
amerikanjunkie
various one

Registered: Aug 2000
Location:
Posts: 1731

It loads all my tabs at once when loaded... like 9 of them, and one of them is a java app

I was just using it as an example...

try it with even eterm... it shows up as something like 14 megs, when it actually only has a incremental cost of 1meg.

Report this post to a moderator | IP: Logged

Old Post 02-08-2006 04:20 PM
amerikanjunkie is offline Click Here to See the Profile for amerikanjunkie Click here to Send amerikanjunkie a Private Message Find more posts by amerikanjunkie Add amerikanjunkie to your buddy list [P] Edit/Delete Message Reply w/Quote
squee
the amen break

Registered: Jul 2001
Location: Norfolk, VA
Posts: 4691

I was wondering about this. I got a CPU monitor theme for superkaramba which told me I was using 250 of 256 megs of RAM...I thought that unlikely since the computer had not slowed down to a crawl.

__________________
What does polite society know of the secret hearts of men?
What shows the shuttered window but all the evil you can imagine?

Report this post to a moderator | IP: Logged

Old Post 02-09-2006 05:20 AM
squee is offline Click Here to See the Profile for squee Click here to Send squee a Private Message Find more posts by squee Add squee to your buddy list [P] Edit/Delete Message Reply w/Quote
All times are GMT. The time now is 07:02 PM. Post New Thread    Post A Reply
  Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread

Forum Jump:
 

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is ON
 

< Contact Us - The Asylum >

Powered by: vBulletin Version 3.0.6
Copyright ©2000 - 2002, Jelsoft Enterprises Limited.
Copyright © 2000- Imaginet Inc.
[Legal Notice] | [Privacy Policy] | [Site Index]