Recent Updates  | Mac Upgrades/Repairs  | CPU Upgrades  | Storage  | Video  | Audio/HT  | Apps/OS/Network
News, Tips, Reviews or Questions to News at Xlr8YourMac.com
Return to News Page


OS X Leopard Virtual Memory
Last Updated: 9/1/2008 (edits for moving swap file)

(Moved from the Aug 29th, 2008 news page due to length) A Mac Pro owner wrote about freezes if VM exceeds 64GB although others (see replies below) are not seeing the problem. (later replies/notes down the page)

" Freezes when using huge virtual memory
My Mac freezes when it uses too much virtual memory: more than 64GB ... which is far away from the Apple advertised several Exabytes ;). Have you heard from others of a similar experience?

I use an 8-core MacPro, OS 10.5.4, with 10GB Ram and a very fast Raid-0 array which is also used for the swap files of the virtual memory (so using VM hurts not too much). (using a tweak/hack to redirect VM) But the same behavior occurs if I start from the original hard disk, so the effect is not disk or Raid related. (drives check OK I assume?-Mike)

I noticed the following problem: when the VM is around 74 GB, 58GB swapped out, (according to the activity monitor) then the Mac freezes. I can move the mouse, but get no other reaction from the Mac. I have to restart via pressing long the power button.
As long as the VM stays below that I can work normally with the Mac. It makes no difference if one or several processes consume the VM. There is enough free space on the hard disk to swap (so the "no space" in the console below can not refer to that).

I wrote a little C program to test the VM performance which I used to reproduce the freeze. I think it is not a problem of the program, as if I choose the parameters such that the memory consummation stays below 64GB it runs fine. And If I increase the parameters or launch two instances of the fine running version I get my freeze.

The last entries in the console were:
26.08.08 09:53:02 Xcode152 Xcode(152,0xb0103000) malloc: free_garbage: garbage ptr = 0x2eae980, has non-zero refcount = 1
26.08.08 09:54:33 kernel (default pager): KERNEL: no space in available paging segments
26.08.08 10:10:40 mds30 (Error) FMW: WE ARE DROPPING FMW EVENTS!
26.08.08 10:10:40 mds30 (Warning) FMW: unknown event:999 ac:0 am:0
26.08.08 10:10:42 kernel (default pager): KERNEL: no space in available paging segments
....(more of the last line)
Best wishes, Yves"

Shortly after posting this, several readers replied they are not seeing this problem:

" Saw the post this morning about a Mac Pro VM problem. I can't replicate this. On my 2008 Mac Pro using 10.5.4, I'm constantly over 64GB of VM (due to keeping Fusion running all the time for my Windows environments). I only have 6GB of (official Apple) RAM and no RAID array, although I did swap out the original drive for a WD 500GB.
I'm at 77GB of VM as I write this, and all is well. However my swapped memory is only at 1GB, so how is he getting 58GB swapped? What apps is he running?
Maybe he can publish his Xcode program somewhere to see if I get the same issue.
Still extremely happy with this machine after upgrading from the Beige G3. :)
-Joey K"

And another reply on no issues with large VM:

"Hi Mike, I have an 8Core (3Ghz) MacPro with 10GB Ram and 10.5.4 and do not experience these freezes using a Samsung F1 750GB as the startup drive.
At the moment of writing this mail the VM is at 95GB, I have more than 20 apps open, the CPUs are maxed out with Boinc and Logic is playing back a session without any problems.
If I had the program he wrote I could make some tests here.
Best regards, Matthias"

And another noting no problems:

"I have an 8 Core (3.2 Ghz) MacPro with 10GB Ram and 10.5.4. I do not experience kernel panics (or freezes) with over 64GB of VM. As I write, my VM is currently 134 GB, with 1.6 GB swap used. I use a 50GB partition of my original 500 GB drive as my boot partition. My VM files are just on my boot partition, unlike the gentlemen with the problem. (although he said it happened without mod to move swap file location). I agree with another comment that having 58GB of swap used sounds extremely high (although, I don't think it should crash the machine).

An earlier reply:

" My only comment, why not increase physical RAM to 32GB, and reduce the swap files by 22GB or more. (More ram would be a plus, but from the later replies above here the problem Yves saw isn't common.)
Swap files always go to the boot drive, unless you 'hack' the OS to direct it elsewhere, which some have tried but never heard it helped. (A tweak for this was first mentioned here back in 2001 (for OS X 10.0.x) several times (very old pages so off-site links are likely no longer valid) - i.e. OS X Swapfile Sizes and Reference Links (July 2001), "SwapCop" utility (from 2001), Notes/Warnings/Tips on Dedicated OS X Swap File Partition and /etc/fstab (June 2001). Wes later wrote with notes on his moving swapfile in Leopard.-Mike)

Note: Unlike most UNIX-based operating systems, Mac OS X does not use a preallocated swap partition for virtual memory. Instead, it uses all of the available space on the machine*s boot partition.
Ref developer.apple.com doc on Memory Management in OS X
And developer.apple.com doc on Viewing Virtual Memory Usage

(he later wrote)
Crucial and OWC sell 4 x 4GB for under $1100, that is actually pretty darn reasonable. Hopefully Yves already has 4 x 2GB which would make for 24GB in all.

Even if it doesn't solve the problem. (I suggested he try a clean install as others have not seen the problem) That is a huge amount of paging going on, even if they are using a couple 10K VelociRaptors. Talking of which, I helped walk someone with G5 2.7DP PCI-X add three VelociRaptors, two on Sonnet G5 Jive as RAID and one natively as boot drive, $1200 investment.

They were going to add it to the drive upgrade DB after they had it running for a couple weeks. Was really happy with results and the new life it breathed into their system, they were still using some original drives. No entry for VelociRaptor there yet, but it does work using on-board, and Sonnet controller in G5s. (Oliver tested the VelociRaptor back in June here in his Mac Pro. The original VelociRaptor drive connector location doesn't mate with Mac Pro HD bays (workaround noted on that review page), so he mounted it in the Optical drive bay. OWC said they're getting some VR new models that fit/mate in the Mac Pro HD bays w/o any mods.-Mike)

The WD 6400AAKS is another winning choice and OWC has it down to $79 Friday, 640GB. Picked up a couple.

Yves (who had the problem) later wrote:

" ... I started experimenting to further localize the problem. I ended with manually influencing the size of the swapfiles (by specifying -S option of dynamic_pager command).

The observation is that the freeze comes always after the swapfile63 was created. So the problem seems to be that not more than 64 swapfiles can be created. By default I get 1GB swapfiles. If I decrease the swap file size to fixed 0.5GB I freeze when I use Ram size +64* 0.5GB so approx 42GB. If I increase the swap file to roughly 2GB I freeze at 137GB.

I can not increase over 2GB per swapfile as always if I try to give numbers greater 2^31 as options, I get error messages in the console afterwards.
My System is
Mac Os 10.5.4 Build 9E17
MacPro3,1 Quad-Core Intel Xeon
Boot-ROM-Version: MP31.006C.B05
SMC Version: 1.25f4

But after spending some hours with this I now leave this machine for the weekend ;)
Best wishes, Yves"

Another reader mail on moving the swap file location:

"I run swap on a separate volume, which is not displayed in finder (volume name starts with a period). I haven't tried to measure performance, though. To move swap in 10.5, modify

I modified the "-F" parameter value. I don't seem to need the fstab entries any more.


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
<plist version="1.0">

After the change, it looks like:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
<plist version="1.0">

-Wes P."

(Ad/Sale items)

= UPGRADES by Mac =
Upgrades just for

= Refurb Mac Pros =
(Click for List)

SSDs up to 4TB
Fast SSDs for Most Macs/PCs

= ThunderBolt =
Drives, Docks & More

Up to 12TB HDDs
HGST, WD, Seagate, Toshiba

= 2.5in HDs & SSDs =
Notebook Hard Drives and DIY drive/case kit bundles

Lifetime warranty RAM Upgrades!

Internal and External Superdrives/Blu-Ray drives

Graphics cards, Displays, Adapters, Cables & more

Interfaces, Cables, Software, Speakers, Headphones & more

Apps, Utilities, OS, VM, Games and more

WiFi and Bluetooth Devices/Adapters/More

= Repair Service =
for iPhone, iPad, Macs

= iPad/iPhone/iPod =
Accessories, Cases, Repairs & More

NuGuard KX Cases
*Extreme* Drop Tested!

XLR8YourMac T-Shirts

Recent Reviews and Articles:
Listing/links to recent articles, guides and reviews you may have missed.  Details

= back to www.XLR8YOURMAC.com =

= Other Site Topic Areas =
Mac Mods/Upgrades | CPU Upgrades | Storage | Video | Audio/HT | OS Updates/Network | Recent

Copyright © 1997-2018. All Rights Reserved.
All brand or product names mentioned are properties of their respective companies.

Legal: Site Privacy and terms/conditions of use.