Making Mac applications to make use of memories larger than 4 GB
Today, I upgraded the memory on my Macbook Pro (2010) from 4 GB to 8 GB. One of the main reasons for the memory upgrade was to be able to run Mircosoft Windows 7 virtual machine using Oracle VirtualBox. However, I noticed that VirtualBox was not able to see more than 4 GB of memory even after the upgrade while the system reported that there was 8 GB of installed memory.
A quick research showed that Mac OS X 10.6 (Snow Leopard) uses 32-bit kernel by default. This limits the applications to use only 4 GB of memory. In order for the applications to use larger memories, one need to use the 64-bit kernel (provided that you are on a 64-bit platform). There is an Apple support page that describes how to select the desired kernel.
I changed the defaults to use 64-bit kernel.
$ sudo systemsetup -setkernelbootarchitecture x86\_64
This configuration is stored in the file /Library/Preferences/SystemConfiguration/com.apple.Boot.plist
?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Kernel Architecture</key> <string>x86_64</string> <key>Kernel Flags</key> <string></string> </dict> </plist>
After making this change and rebooting, VirtualBox was able to see the whole memory.