comparing resources using top

1

Fedora 15 Alpha

3861 user     20   0  904m 128m  33m S  0.7  6.4   1:11.52 xulrunner-bin                                     
 1323 user     20   0 1555m  95m  31m S 13.5  4.8   4:06.87 gnome-shell                                       
 3494 user     20   0 1028m  50m  21m S 12.8  2.5   1:43.32 evolution  

I just wondering what is the difference between RES, SHR, and VIRT.

1) The VIRT always seems to be higher. Is this using the paging file system. (virtual memory on the harddisk, the swap memory)

2) Is the RES memory the actual physical RAM memory?

3) Is shared memory sharing memory with other processes?

4) Just a final question. As I am running on a HP Mini 210, memory and CPU is a resource I don't have a abundence of. So if was to compare for example 2 difference browsers i.e. firefox and midora. What should I brench mark between to 2 to find what one uses less resources?

Many thanks for any suggestions,

ant2009

Posted 2011-04-06T07:47:50.930

Reputation: 2 595

Answers

1

Stacey's already answered questions 1-3, so I'll just hit #4: %CPU and %MEM will show you the current percentages of CPU and memory consumed by the process, so they're good to watch for spikes while specific operations are being done in each browser. For a better long-term picture, you'd want to run each browser for a few hours (or longer, depending on your browsing habits), then take a look at VIRT (to see how big it's grown in memory) and TIME (the total amount of CPU time used over the life of the process).

And don't forget that browsers will often spawn multiple processes, so be sure to check whether that's the case for the browser you're testing.

Dave Sherohman

Posted 2011-04-06T07:47:50.930

Reputation: 5 143

2

From man top:

VIRT -- Virtual Image (kb) The total amount of virtual memory used by the task. It includes all code, data and shared libraries plus pages that have been swapped out and pages that have been mapped but not used.

RES -- Resident size (kb) The non-swapped physical memory a task has used.

SHR -- Shared Mem size (kb) The amount of shared memory used by a task. It simply reflects memory that could be potentially shared with other processes.

Stacey Richards

Posted 2011-04-06T07:47:50.930

Reputation: 1 292