<info> <name>Phil Bull</name> <email>philbull@gmail.com</email> <years>2011</years> <name>Michael Hill</name> <email>mdhillca@gmail.com</email> <years>2011, 2014</years> <desc>View the memory map of a process.</desc> </info> <comment> Phil Bull

Explain how to use the Memory Map feature.

</comment>

<gui>Virtual memory</gui> is a representation of the combined <gui>physical memory</gui> and swap space in a system. It enables running processes to access more than the existing physical memory by <gui>mapping</gui> locations in physical memory to files on disk. When the system needs more pages of memory than are available, some of the existing pages will be paged out or written to the swap space.

The <gui>memory map</gui> displays the total virtual memory use of the process, and can be used to determine the memory cost of running a single or multiple instances of the program, to ensure the use of the correct shared libraries, to see the results of adjusting various performance tuning parameters the program may have, or to diagnose issues such as memory leaks.

To display the memory map of a process:

<steps> <item>

Click the <gui>Processes</gui> tab.

</item> <item>

Right click the desired process in the <gui>process list</gui>.

</item> <item>

Click <gui>Memory Maps</gui>.

</item> </steps>
Reading the memory map

<list> <item>

Addresses are displayed in hexadecimal (base 16).

</item> <item>

Sizes are displayed in IEC binary prefixes.

</item> <item>

At runtime the process can allocate more memory dynamically into an area called the heap, and store arguments and variables into another area called the stack.

</item> <item>

The program itself and each of the shared libraries has three entries each, one for the read-execute text segment, one for the read-write data segment and one for a read-only data segment. Both data segments need to be paged out at swap time.

</item> </list>

Properties
Filename | The location of a shared library that is currently used by the process. If this field is blank, the memory information in this row describes memory that is owned by the process whose name is displayed above the memory-map table.
VM Start | The address at which the memory segment begins. VM Start, VM End and VM Offset together specify the location on disk to which the shared library is mapped.
VM End | The address at which the memory segment ends.
VM Size | The size of the memory segment.

Flags

The following flags describe the different types of memory-segment access that the process can have:

<terms> <item> <gui>p</gui>

The memory segment is private to the process, and is not accessible to other processes.

</item> <item> <gui>r</gui>

The process has permission to read from the memory segment.

</item> <item> <gui>s</gui>

The memory segment is shared with other processes.

</item> <item> <gui>w</gui>

The process has permission to write into the memory segment.

</item> <item> <gui>x</gui>

The process has permission to execute instructions that are contained within the memory segment.

</item> </terms>

VM Offset | The location of the address within the memory segment, measured from VM Start.

Private, Shared, Clean, Dirty

<list><item>

private pages are accessed by one process

</item> <item>

shared pages can be accessed by more than one process

</item> <item>

clean pages have not yet been modified while in memory and can be discarded when designated to be swapped out

</item> <item>

dirty pages have been modified while in memory and must be written to disk when designated to be swapped out

</item></list>

Device | The major and minor numbers of the device on which the shared library filename is located. Together these specify a partition on the system.
Inode | The inode on the device from which the shared library location is loaded into memory. An inode is the structure the filesystem uses to store a file, and the number assigned to it is unique.