Hacker News new | ask | show | jobs
by silasb 5185 days ago
OT question for you: I'm a developer that does a lot of web development, from Perl to RoR. When I end up starting more than 1 VM with 4 GB RAM, my computer literally dies with Mac OS X. Now this is all with VirtualBox, which I suspect isn't the best all around VM application.

For some reason I feel that it is the crappy memory management with OS X that is killing me.

Other than getting more RAM do you do anything special? What VM software and how much RAM you running.

6 comments

First, even if its the answer you ruled out: get a machine with lots of RAM. Don't care about the rest, even an SSD is not that important, just cram as much of RAM into the machine as possible. 8GB would be good, 16 is better. Make sure that the OS has enough space to shuffle memory.

Use tiny VMs. Most development stacks do actually fit in 512MB, as long as there is nothing else running. Pay attention about which parts of your dev stack do actually consume the memory. In my case, it's mostly in-memory databases. Sample those for smaller datasets, its good practice anyways. If its still not enough, use odd values like 700MB. Rule memory leaks out (this is one of the big advantages of small VMs: memory leaks are easy to find).

Also, use one VM per project. Unless projects are tiny, putting 2 in one VM only replicates the problems of your host-system.

Finally, I also use VirtualBox with Vagrant and am quite okay with it.

This is what I'm thinking, I'm kinda spoiled at home with both my main box and my VM server each having 8 GB.

You do make a good point about the extra cruft that isn't needed for a VM. I should actually know this as I have several LEBs on the web and optimize them highly for low memory usage. I guess personal time < work time.

More RAM, period.

Going from 4GB to 8GB on my mbp made a huge difference running VMs. Also, get Fusion. For working in VMs all day Fusion has worked better for me over VirtualBox.

You should try out Parallels then, as I find it much snappier than Fusion. After having tried Virtual Box, Fusion and Parallels, I kept the last one as it provides the best experience of the three imo.
Why such intensely large VMs? I've gotten by with 256MB appliances that then get their source deployed into big iron on-site, or into the cloud.
> my computer literally dies with Mac OS X. Now this is all with VirtualBox, which I suspect isn't the best all around VM application.

Asked and answered. I like VirtualBox - the price is right for when I just need to run an app or two on rare occasion - but it certainly isn't the most stable or least OS-crashing VM I've ever used.

What's your machine?

More RAM would certainly help, more CPU cores (real cores, not hyper-threaded "virtual" cores) will too.

I have a Quad Core i5 in my iMac with 4 GB RAM, boss doesn't wanna spend the money to upgrade :( Need to convince him otherwise.
What is this "crappy" memory management of OS X that you speak of? When it comes to memory management, OS X is definitely among the best from my 14 years of experience with modern operating systems. For what it's worth, I regularly run two VMs in VirtualBox totalling just over 2gb of guest RAM allowance, on a 4gb machine running 10.6.8, and I don't suffer problems with this. Users of 10.7 claim that it's a wee bit hungrier than 10.6, though I still can't recall the last time I saw anything else than "Swap used: 0 byte" in the Activity Monitor.
I can't seem to find the blog post about the memory architecture in Mac OS X, but it was rather recent, under 8 months ago some guy blogged about the crappy memory management that was used in OS X and why he ended up switching platforms.

I have yet to try 10.7 stuck on 10.6 until the boss allows us to upgrade. This will probably be my next big upgrade before anything else.