Chapter 6. IRIX Memory Usage

This section describes commands that provide information about physical and virtual memory usage on the IRIX operating system.

This chapter contains the following sections:

Memory Usage Commands

Most of the memory usage commands provide a snapshot view of the current memory usage either on a per process basis or a per job basis.

Examples of per process commands are as follows:

  • gmemusage(1)

  • pmem(1)

  • top(1)

  • ps(1)

For more information on these commands, see the appropriate man page.

Per job commands include the following:

  • jstat(1)

The Comprehensive System Accounting (CSA) commands, such as, csacom(1) and ja(1), provide historical memory usage information after a process or job terminates.

The jstat(1) command reports the current usage and highwater memory values of all concurrently running processes within a job.

If the -l option is specified, the jstat command will print out the current usage, high usage, current limit, and maximum limit information for the current job. (Note that vmemory is virtual memory and ressetsize is resident set size).

The following example shows the output of the jstat -l option:

 % jstat -l


          JID                OWNER          COMMAND
          ------------------ -------------- --------------
          0x106f             user1          -tcsh



          LIMIT NAME         USAGE          HIGH USAGE     CURRENT LIMIT  MAX LIMIT
          ------------------ -------------- -------------- -------------- --------------
          cputime            0              0              unlimited      unlimited
          datasize           272k           544k           unlimited      unlimited
          files              8              32             400            5000
          vmemory            4224k          14112k         unlimited      unlimited
          ressetsize         3520k          6384k          unlimited      unlimited
          threads            1              1              unlimited      unlimited
          processes          2              7              1024           1024
          physmem            3520k          6384k          unlimited      unlimited

The -s option of the ja(1) command reports the highwater memory value of the single largest process memory within a job.

It is not a cumulative highwater mark of all processes within the job since this value is gathered from the accounting records of terminated processes.

The following example shows the output of the ja -s option:

% ja -s

Job CSA Accounting - Summary Report
          ====================================

          Job Accounting File Name         : /tmp/ja.username
          Operating System                 : IRIX64 snow 6.5 10120733 IP27
          User Name (ID)                   : username (10320)
          Group Name (ID)                  : resmgmt (16061)
          Project Name (ID)                : CSA(40)
          Array Session Handle             : 0x000000000000034b
          Job ID                           : 0x310
          Report Starts                    : 01/23/00 18:13:38
          Report Ends                      : 01/23/00 18:17:05
          Elapsed Time                     :          207      Seconds
          User CPU Time                    :            0.9340 Seconds
          System CPU Time                  :            0.0643 Seconds
          Run Queue Wait Time              :            0.6463 Seconds
          Block I/O Wait Time              :            0.1888 Seconds
          Raw I/O Wait Time                :            0.1323 Seconds
          CPU Time Core Memory Integral    :            0.4305 Mbyte-seconds
          CPU Time Virtual Memory Integral :            4.3298 Mbyte-seconds
          Maximum Core Memory Used         :            0.1094 Mbytes
          Maximum Virtual Memory Used      :           38.0000 Mbytes
          Characters Read                  :            0.0603 Mbytes
          Characters Written               :            0.0023 Mbytes
          Blocks Read                      :            7
          Blocks Written                   :            0
          Logical I/O Read Requests        :           35
          Logical I/O Write Requests       :           42
          Number of Commands               :            7
          System Billing Units             :            0.0000

The CSA memory integrals report the amount of memory used over CPU time, measured at clock intervals.

CSA, extended accounting, and the jstat (1) command all access the same kernel counters for per process memory size. Additional kernel counters accumulate these per process memory size values into job memory size values as reported by the jstat command. CSA does its accumulation into job values outside of the kernel.

Shared Memory

Both job limits and CSA report memory usage values for all processes in a job. Processes in the job can access shared memory segments. Those segments can be shared between processes in the job or with processes outside the job, depending on the type of shared memory segment involved. When determining the memory usage for the job as a whole, shared memory segments are counted once for each process that accesses the segment. This can result in a usage value that is much larger than expected. This is particularly true for parallel applications where a large number of processes share one or more memory segments.

Shared memory between processes is not prorated by CSA or the jstat command. The shared memory pages, both physical and virtual, are counted in the memory size for each process accessing the pages.

Physical Memory

The kernel calculates the physical highwater memory value, current usage value, and memory integral value at periodic intervals. These values are the resident set size for the process or job, but do not include pages associated with mapped devices (for example, a graphics device).

Virtual Memory

Unlike physical memory usage values, the kernel keeps virtual memory values continuously current in kernel counters. The kernel increments the CSA highwater value when the process virtual memory size increases. The jstat current usage and highwater value are set, as applicable, at periodic intervals in the kernel. The kernel also calculates the CSA virtual memory integral at periodic intervals.

These values include the virtual memory size (text, data, stack, shared memory, mapped files, shared libraries) for the process or job, but do not include pages associated with mapped devices (for example, a graphics device).