Working Set is the set of actively used pages. A process needs that amount of physical memory to run properly. If there is not enough physical memory, process will spent considerable amount of time to swapping. Thus performance will be degraded. If this problem is system wide, all process are hungry for physical memory, system will spent most of time to swapping witout any actual work. This is called thrasing.
Linux
top Command for Process Memory Usage
· RES shows the actual physical RAM used by your process.
· VIRT shows the actual virtual memory reserved by your process.
· DATA shows the amount of virtual private anonymous memory reserved by your process. That memory may or may not be mapped to physical RAM. It corresponds to the amount of memory intended to store process specific data (not shared).
· SHR shows the subset of resident memory that is file-backed (including shared anonymous memory). It represents the amount of resident memory that may be used by other processes.
1- Shows total amount of physical memory
2- Shows free amount of free memory availble to applicatios. It is sum of buffers, cached and free memory fields. This is because linux uses memory to cache disk content for performance reasons. If memory is needed it is reclaimed and given to applications.
pmap Command for Detailed Process Memory Usage
Pmap command lists details about all mappings made by process. With –x switch:
- Column 1 shows address of the mapping
- Column 2 shows size of mapping
- Column 3 shows resident size of mapping, in other words physical memory used.
- Column 4 shows dirty mappings. Those are file backed shared mappings which are modified but not synchronized with backing file.
- Column 5 shows details about access rights:
o r shows readable mappings
o w shows writable mappings
o x shows executable mappings
o s shows shared mappings
- Column 6 shows Mapping type of the mapping. If it is file backed, backing file is shown. If it is anonymous, anon is displayed. Stack areas are shown with stack label.
Last line displays total of each column. A closer look will reveal that same files are mappend mutiple times with different access rights. This is because executable files contains different blocks like text, data, rodata, bss.
With –d switch, pmap shows details about total mapped memory, total writable/private memory and total shared memory. Writeable/private stat is worth mentioning. If There are multiple process of the same executable, this stat shows memory cost of this particular process. All other mappings are shared with other processes. For such processes pmap –d gives more accurate information than top command.
Pmap command uses data that is resident in /proc/[pid]/maps file. In some cases this file may contain more usable information.
Windows
Task Manager for Memory Stats
Details about stats can be found in What do the Task Manager memory columns mean?. Columns worth mentioning are:
- Working Set is similar to RSS in linux top command and shows total amount of physical memory used including shared memory.
- Private Working Set is like Workig Set, except it excludes shared memory.
- Commit Size is similar to VIRT in linux top command and shows total amount of virtual memory reserverd for process.
VMMap for Detailed Memory Stats
VMMap is a utility program that can be downloaded separetly for learning detailed memory mapping information of a process.
Quick Help menu will display definitions of columns.
Comments
Post a Comment