gmemusage [ -i interval ] [ -m | -p | -r | -s ] [ -u ] [ -a aiff-file ] [ -g growth-threshhold ] [ -t thresh ] [ -d delta ] [ progs ... ]
In addition, gmemusage will display a breakdown of the regions within a program. Clicking on a bar or program name in the main chart will replace the main chart with a chart for that program, with each region labeled with one of Text, Data, Break, Stack, Shmem, Physical Device, RW, RO, and (if possible) the base name of the file or device corresponding to each region. If gmemusage is unable to determine the base name of the file or device for a region that does correspond to a file or device, gmemusage will display the inode number of the file or device.
The meanings of these labels are as follows:
Clicking on the Irix bar in Physical Memory Breakdown mode (see below) causes gmemusage to display a breakdown of the memory that it is charging to the operating system. Separate items include FS Cache, Buffer Data, Heap, Streams, Zone, BSD Networking, Page Frame Data, Kernel Tables, Unix Data Space, Unix Code Space, Symmon, and Other.
When viewing the breakdown of program memory usage, clicking and dragging on the shadow bar will switch the display to another program.
The first time a program is clicked on, gmemusage reads in information about executables and libraries on the system while displaying a wait message. gmemusage keeps this information in its database file $HOME/.gmemusage.inodes. if this file does not exist or is older than /unix, gmemusage will create it, which can take as long as a minute. If the database already exists and is newer than /unix, reading it will only take a few seconds. See ENVIRONMENT VARIABLES below for information on customizing $HOME/.gmemusage.inodes.
gmemusage has four different modes of viewing. The default mode, Physical Memory Breakdown, shows the amount of physical memory being used by each process, the amount of free memory, and the amount of memory being used by Irix. The amount of memory charged to each process is calculated by taking the pages each process has in memory and pro-rating the sizes with the number of processes using each page.
The mode Total Sizes of Process shows the the total sizes of all the processes in the system. This corresponds to the SZ field of ps(1) output.
The mode Resident Sizes of Processes shows the resident sizes of all the processes in the system. This corresponds to the RSS field of ps(1) output.
The mode Resident Mappings shows the resident sizes of all mapped objects in the system. A mapped object can correspond to an executable file, a dynamic shared object, a memory mapped file, or a region attached to a process by rld(1).
By default, gmemusage only displays programs that are using more than 500 kilobytes of memory; programs using less than this are lumped together and labeled < 500. This threshhold is specifiable on the command line and changeable at run time.
Alternatively, a list of programs to monitor can be specified on the command line (see below). In this case, a bar for each of the programs specified appears (as long as that program is running) and any threshhold is ignored.
In addition to the four basic viewing modes and the process region breakdown, gmemusage cycles through displays of additional information when the 'v' key is pressed. This additional information is a subdivision of each bar in the chart, with the right portion of each bar corresponding to the additional information. Down the right side of the window the values corresponding to the right portion of each bar are displayed.
The following additional information is available:
If the environment variable USAGESOUND is set to a valid aiff file, and playaiff(1) is installed, gmemusage will use playaiff(1) to play $USAGESOUND when viewing a program's region breakdown and the program grows by a threshholded amount. The command line option -a can be used as an alternative to the environment for specifying a sound file, and the growth threshhold can be specified on the command line (see below).
gmemusage has the following command line options:
Pressing the 'v' key cycles through the available additional information for the current mode (see above discussion of additional information).
The up arrow key increases the threshhold by 50 kilobytes (default) or, if the -d option was specified, by delta kilobytes. The down arrow key decreases the threshhold by the same amount. When the threshhold is decreased to 0, all progams running are displayed, even those that use no memory (such as kernel processes).
In the main view, clicking on a program's bar causes gmemusage to display a detailed memory usage chart for that program. In the detailed usage view, clicking on the shadow bar switches the program being displayed, and clicking outside the shadow bar or pressing the space bar returns to the main view.
At any time, pressing the 't' key causes gmemusage to print statistics about the current view to the terminal window. The fields in each line are separated by tab characters to simplify the parsing of the output by other programs (they are also padded with spaces). There are three different types of print outs: All Programs, Resident Mappings, and program breakdown. Which gets printed depends on the mode gmemusage is in when 't' is pressed.
The 'h' key brings up an on-line help screen, and the space bar returns from there to viewing memory. The escape key exits.
gmemusage -p -t 1000 -d 100
Bring up gmemusage in Physical Memory Breakdown mode, with programs using 1000 kilobytes or more of memory displayed separately in their own bars. The up and down arrow keys will increase and decrease the threshhold by 100 kilobytes respectively.
gmemusage -r xwsh toolchest 4Dwm Xsgi fm
Bring up gmemusage in Resident Sizes of Processes mode. Display bars for xwsh(1), toolchest(1), 4Dwm(1), Xsgi(1), and fm(1). All other programs will be combined into a bar labeled Other.
/usr/ToolTalk:/usr/bin:/usr/lib:/usr/local:/usr/Cadmin: /usr/CaseVision:/usr/sbin:/usr/bsd:/usr/etc:/lib:/sbin: /bin:/etc:/usr/gfx
Beware of "shared object amortization". When a program that uses a shared object (e.g. libXm.so) is started, the memory usage of all other programs that use that shared object can decrease. This is because the amount of memory charged to each program for shared object usage is prorated based on the amount of sharing.
If you have problems, questions, or comments, please send mail to rogerc@sgi.com.