Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

How do I sum up the total memory used? Do I use the RES column or VIRT column or ? Below is the output of top in my system.

Mem:   5859244k total,  5657732k used,   201512k free,    80980k buffers
Swap:  6144852k total,      100k used,  6144752k free,  5147836k cached

PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
1704 verde     21   0 1228m  59m  18m S  0.3  1.0   0:14.79 java
27623 verde     16   0  941m  36m  11m S  0.0  0.6   0:12.43 java
27250 oracle    15   0  310m  16m  15m S  0.0  0.3   0:00.11 oracle
2791 root      34  19  251m  15m 2232 S  0.0  0.3   0:03.72 yum-updatesd
27248 oracle    16   0  310m  10m 9644 S  0.0  0.2   0:00.50 oracle
27246 oracle    15   0  315m  10m 9028 S  0.0  0.2   0:00.11 oracle
27252 oracle    18   0  310m  10m 9460 S  0.0  0.2   0:00.02 oracle
27622 verde     25   0  213m  10m 6128 S  0.0  0.2   0:01.07 rmiregistry
27244 oracle    15   0  312m 9552 7032 S  0.0  0.2   0:00.09 oracle
27242 oracle    15   0  311m 8472 7136 S  0.0  0.1   0:00.37 oracle
27264 oracle    18   0  310m 7152 5712 S  0.0  0.1   0:00.02 oracle
27266 oracle    18   0  310m 7152 5712 S  0.0  0.1   0:00.02 oracle
27262 oracle    18   0  310m 7148 5712 S  0.0  0.1   0:00.01 oracle
27268 oracle    18   0  310m 7144 5708 S  0.0  0.1   0:00.02 oracle
27278 oracle    15   0  314m 7144 6068 S  0.0  0.1   0:00.05 oracle
27270 oracle    18   0  310m 7132 5692 S  0.0  0.1   0:00.02 oracle
27274 oracle    18   0  310m 7128 5688 S  0.0  0.1   0:00.02 oracle
27276 oracle    18   0  310m 7128 5692 S  0.0  0.1   0:00.02 oracle
27272 oracle    18   0  310m 7124 5688 S  0.0  0.1   0:00.02 oracle
27280 oracle    18   0  314m 7064 6016 S  0.0  0.1   0:00.02 oracle
27256 oracle    18   0  311m 6976 5724 S  0.0  0.1   0:00.01 oracle
27258 oracle    18   0  311m 6972 5724 S  0.0  0.1   0:00.01 oracle
27254 oracle    18   0  311m 6968 5720 S  0.0  0.1   0:00.03 oracle

27260 oracle 18 0 311m 6936 5688 S 0.0 0.1 0:00.02 oracle 2725 haldaemo 15 0 30640 3844 1696 S 0.0 0.1 0:06.76 hald

share|improve this question
    
do you want the sum for the hole system or for some processes? –  Christian Feb 1 '10 at 7:11

2 Answers 2

up vote 1 down vote accepted

well the simplest thing to type is :

free -m 

(where m gives you the output in mega-bytes, g, for giga, etc...)

plop@pouet:~$ free -m
             total       used       free     shared    buffers     cached
Mem:          1994       1729        264          0        491        703
-/+ buffers/cache:        534       1459
Swap:          509         33        476
share|improve this answer

I'd use neither. In the above example, VIRT is the amount of virtual memory the process requrires, RES is the process specific resident amount of memory, SHR is the amount of memory that is shared between two or more processes. So it is a bit difficult to resolve the basic amount of memory used in the system using top.

You can use the header information and do:

 base-memory-use = used - buffers - cached

Buffers and Cached memory are dynamically changing. Basically a Linux system tries to use all available memory to make the system faster. Spare memory is used for buffers and cache but when processes need this memory, these areas are shrinked as needed.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.