What Is Activity Monitor (or How to Take Your Mac's Pulse)
Subject:   VM versus swap
Date:   2005-10-04 18:33:40
From:   hayne
The article says "The VM Size figure is the amount of hard disk space being used for virtual memory or swap file".

This is glossing over the difference between the virtual memory and the swap file(s). The size shown for VM in Activity Monitor (and in 'top') is the total of the amounts of virtual memory allocated by the processes. But not all of this virtual memory is represented in the swap file(s). The system only writes the portion of VM that is actually used to the swap file(s) when more RAM is needed for something else. So the size of the swap file(s) is generally much less than the size shown for VM in Activity Monitor.

You can see what swap files you have at the moment by looking in the folder /var/vm
And you can see the total size of the swap files by running the following command in a Terminal window:

/usr/bin/du -hc /var/vm/swap*

Full Threads Oldest First

Showing messages 1 through 3 of 3.

  • VM versus swap
    2005-10-05 11:51:18  lucbelanger [View]

    In Tiger you can just use the sysctl utility on the CLI

    sysctl vm

    which give a better idea of your VM usage than the "du" solution

    vm.loadavg: 0.41 0.67 0.50
    vm.swapusage: total = 128.00M used = 78.31M free = 49.69M

    • VM versus swap
      2005-10-08 01:08:58  sjk [View]

      vm.swapusage reminds me of the missing swapmode in pstat (pre-10.4):

      % pstat -T
      520/12288 files
      10619 vnodes
      swapmode is not (yet) available under Mach

      Anyone know how to obtain the files and vnode info on 10.4 since the pstat command is gone?