As my Mac got upgraded to 8 GiB RAM, certain apps like VirtualBox was not able to use more than 4 GiB RAM.The obvious solution was to enable 64 bit kernel. Of-course the downside is, you’ll end up recompiling certain pieces of sofware.
sudo systemsetup -setkernelbootarchitecture x86_64