vm
The vm command is a good way to determine how efficient your Mac is when it runs low on memory, an issue particularly with the MacBook Pro, which maxes-out at 8GB of real memory.
A quality solid state drive is your best bet for fast virtual memory, because it has no seek time, and virtually no latency, along with very high write speed (with a quality SSD). The OWC Mercury Extreme is a great choice.
The vm command exercises the virtual memory subsystem:
- Memory is allocated that exceeds the available physical memory by 12.5% (eg 9GB for an 8GB system, you can choose another amount if desired) ;
- The memory is cleared;
- The memory is then read in its entirety (by comparing memory). The forces the system to swap (page) memory from and to disk.
- Timings are output when done (default 5 iterations).
When a solid state drive (SSD) is involved, the write speed and write operations per second both come into play. But with some SSDs, write performance degrades over time, so this benchmark can give you an idea of performance now, but not necessarily over time. Stick with a high quality model with over-provisioning that maintains performance and reliability.
Running MemoryTester 'vm'
Using MemoryTester.app, select the Virtual Memory command, then click Start.
The following are strongly advised when running this test:
- Restart your Mac.
- Turn off File Sharing and other services.
- Quit other applications, because they are likely to be unusable while the test is running (very sluggish). You might even want to quit the Finder.
- This is a long-running test, allow 1-3 hours.
Note: test results can be quite variable each iteration because virtual memory is a complex system.
Note 2: Mac OS X has a sporadic bug when allocating virtual memory; this can occasionally cause an extra long startup time for the test, or even a “hang”. To work around the bug (when it occurs), launch any program (eg TextEdit), then quit it. Remarkably, this works, seemingly prodding the system to continue! The initial “allocating and clearing” time should generally be disregarded.
Command line usage
You can specify the number of read iterations, and the amount of memory to be allocated.
vm [--iterations|-i <num>] "5"
Run the virtual memory tests with defaults:
mt vm
Run the test using 9/13/25GB memory usage and 5/10/15 iterations respectively:
mt vm --iterations 5 9GB
mt vm --iterations 10 13GB
mt vm --iterations 20 25GB
Copyright © 2008-2010 diglloyd Inc, all rights reserved