Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Noticed a few discrepancies in the reports generated on my VPS:
Total Used Free
top command 262 132 129
free command 256 129 126
Not sure why but the top command gives an extra 3MB for both used and free memory.
Also, notice that there are a total of 29 rows of information returned by the top command for the httpd process. Each row indicates they took an average of 3.5-3.6%. Well, 29 * 3.5 = 101.5%. How can this be possible for two things: 1) The number greater than 100%. 2) The number doesn't correlate with the memory usage details returned by the top and free commands.
The output of top is very hard to read. Please post the output of commands in [CODE] tags for easier reading. It's the # toolbar button after you click 'Go Advanced'.
Be better if you provide more detail on what you did. Let me guess you just dropped the last 3 digits from the top numbers - try dividing them by 1024 and see what happens.
Understanding kilo/mega/kibi/mebi-byte would be essential to reporting memory. Wikipedia has a good article.
Memory usage reported by top includes shared libraries. Correct memory accounting is non-trivial.
Wow it is indeed due to the 1024 vs 1000 issue. Thanks.
As for why the httpd process's memory% added up to more than 100% vs what both the top and free command indicates to have been consumed, any idea?
Both top and free indicates that there are almost 50% memory left. But httpd indicated by top suggests that the httpd alone has already taken all memory? Puzzled.
Noticed a few discrepancies in the reports generated on my VPS:
Total Used Free
top command 262 132 129
free command 256 129 126
Not sure why but the top command gives an extra 3MB for both used and free memory.
Also, notice that there are a total of 29 rows of information returned by the top command for the httpd process. Each row indicates they took an average of 3.5-3.6%. Well, 29 * 3.5 = 101.5%. How can this be possible for two things: 1) The number greater than 100%. 2) The number doesn't correlate with the memory usage details returned by the top and free commands.
It indicates the task’s currently used share of available physical memory.
Means suppose your MEM is 100 MB and the first task is taking 5% of memory .Now the available memory is 95 MB .Now anothe task is taking 5% ,i.e. not 5% of 100 MB but 5% available memory that is of 95 MB = 4.75 MB .
Now calculate and post , how your memory usage is above 100% ?
Means suppose your MEM is 100 MB and the first task is taking 5% of memory .Now the available memory is 95 MB .Now anothe task is taking 5% ,i.e. not 5% of 100 MB but 5% available memory that is of 95 MB = 4.75 MB .
Thanks. This is something that I'll never find out from the books. It's a bit too intricate to be described in the books. So thanks for pointing this out.
Can you kindly let me know how did you come to know about this? You must have some great references.
Nevertheless, this is some messed up way of displaying what memory usage a process is consuming. Why would anyone be interested in knowing how much remaining memory was used? The information can be rather unworthy. Afterall, how do we know in which sequence is the memory calculated.
I doubt that explanation - top just reads the various entries in /proc.
As I said, the memory reported for each process is not just that processes usage. Have a read of this - it discusses "ps", but is equally applicable to "top".
Thanks. This is something that I'll never find out from the books. It's a bit too intricate to be described in the books. So thanks for pointing this out.
Can you kindly let me know how did you come to know about this? You must have some great references.
Nevertheless, this is some messed up way of displaying what memory usage a process is consuming. Why would anyone be interested in knowing how much remaining memory was used? The information can be rather unworthy. Afterall, how do we know in which sequence is the memory calculated.
You are welcome .
We dont have to bother about the sequence, its the work of OS , which task to start first and assign memory according to the need of that process . You can get them by sequence of PID .
We dont have to bother about the sequence, its the work of OS , which task to start first and assign memory according to the need of that process . You can get them by sequence of PID .
Actually, just finished reading the article linked by syg00. I think that's the proper actual workings in explaining why all the httpd processes displayed by ps exceeds 100% of memory. Can you please take a look. It's a good read.
Means suppose your MEM is 100 MB and the first task is taking 5% of memory .Now the available memory is 95 MB .Now anothe task is taking 5% ,i.e. not 5% of 100 MB but 5% available memory that is of 95 MB = 4.75 MB .
Quote:
Originally Posted by syg00
I doubt that explanation
Don't leave the OP in doubt by being too polite. divyashree's explanation was total nonsense (sorry I don't know a polite way to say that).
Quote:
Originally Posted by grob115
just finished reading the article linked by syg00. I think that's the proper actual workings in explaining why all the httpd processes displayed by ps exceeds 100% of memory.
Don't leave the OP in doubt by being too polite. divyashree's explanation was total nonsense (sorry I don't know a polite way to say that).
divyashree, seriously you should read that link about how ps displays the memory and how you can use pmap to see what's happening. It makes no sense for a kernel programmer to add in the additional consideration of how much memory has been used and use the remaining memory for the calculation. The resulting figure will mislead the user of the output and add additional coding logic. So why bother.
Just out of curiosity, does Solaris have an implementation of the WBEM service like the Windows WMI? I've been using Solaris 5.8 and 5.10 but have never seen any WMI like feature whether through command line or GUI. Well we don't use GUI... just putty. But also not awared of such thing being available via CLI. Is there such thing available?
Yeah,above discussion is correct about psas it displays total memory used by a process which includes shared libraries loaded in memory,which are simultaneously used by other processes too!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.