Getting Rid of Kernel Panics When Running The Android Emulator Under OS X Lion

by Hans Petter

Kernel Panic

Photo by badcrc (flickr)

After OS X Lion was released a few months ago, both me and a lot of other people have experienced

kernel panics at seemingly random times when running the Android emulator from Eclipse. Seemingly unrelated I also noticed that Eclipse sometimes used 100% CPU after it had been running for some time. I increased the heap space allocated to Eclipse, and after doing this the problem disappeared. What is even better is that this seems to have prevent the kernel panics from occuring as well, at least I haven’t experienced any since increasing the heap space.

Personally I set the minimum to 256MB and the maximum to 1024MB, which have worked well for me. But, this depends on the specification of your computer, so take a look at this guide for an idea of what values you should use.

The fix for the problem is easy. Find the Eclipse executable in Finder, double-click and select “Show contents in package”. Open the file eclipse.ini, located in Contents/MacOS. Adjust the memory allocation using the following values:

--launcher.XXMaxPermSize256m
-Xms256m
-Xmx1024m