-   Linux - General (
-   -   Total Memory and Swap Used As Reported by top (

firask317 07-18-2013 01:54 PM

Total Memory and Swap Used As Reported by top
Hi there!
I have three questions regarding top command. On my Squid server with 192 GB of DDR RAM, top reports the following:

Mem: 198332816k total, 197818004k used, 514812k free, 987408k buffers

Here are my questions:
1- Why does top see only 198332816k (189.1 GB) of total physical memory (192 GB)?

2- When sorting processes according to their RES (resident memory size), squid is reported to use about 10 GB of the memory, all other processes use about 1GB of memory together. So knowing that top reports most of my physical memory is used, where did this used memory go?

3- I had this question while monitoring top on another recently booted Linux server. top reports that swap usage is 0k, but nevertheless there are many processes with VIRT (Virtual Image) value greater than the resident memory size, which means that, I guess, there must be some swap usage. Would you please explain this to me?

Thanks a lot in advance!

Firerat 07-18-2013 02:09 PM

1/ I think it might be some confusion between GB and GiB,
the same reason a hard drive is never as big as the one you bought :)

2/ Disk cache

3/ best I paste this

basically all the bits of mem it has, video ram, shared libs and so on

jefro 07-18-2013 03:49 PM

Wonder if part of that ram is being reserved for video or other bios functions?

Top isn't an exact report as far as I understand. Could be wrong.

Z038 07-18-2013 05:32 PM

I had never heard of the IEC prefixes (kibi, mebi, gibi, etc.) until about 10 or 12 years ago. I had always considered kilo, mega, and giga prefixes to refer to binary orders of magnitude, kilo meaning 2 to the 10th power, or 1024, mega meaning 2 to the 20th power, or 1024 squared, giga meaning 2 to the 30th power, or 1024 cubed, and so on.

I understand why it is desirable to differentiate between powers of 10 and powers of 2, but I have a hard time using those IEC prefixes after a previous 20 year habit of using the normal prefixes to refer to binary orders of magnitude. I can't help thinking how silly the IEC prefixes sound and look to me. It's a personal problem, I admit. And I know other people who don't find the IEC prefixes odd at all.

syg00 07-19-2013 03:31 AM

Anyone who uses Z038 as a handle has been in this business way too long.

Z038 07-19-2013 08:32 AM

Well, you got that right syg00, but I think anyone who recognizes that probably has been around a while too. :-)

All times are GMT -5. The time now is 05:14 AM.