Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I build Android-4.0.4 for odroid-x on a lenovo x220 core i7 8GB of RAM running Linux Mint 12 (Ubuntu-11.10). I start 5 jobs to build, and after a while OOM triggers and kills dozen of processes until it kills the java processes started by my build, and feels happy with it. By happy, I mean Linux does not trigger OOM afterward. I have uploaded my dmesg after the process slaughter finished. First OOM kills my chrome tabs, but they are innocent since OOM still triggers after they've all been killed.

But even after they have all been killed, OOM still triggers and looks for someone else to sacrifice. It gets to the java processes started by my make command. It killed them one by one: CODE:

$ grep -i "kill process" dmesg.txt 
[181532.565512] Out of memory: Kill process 9161 (chromium-browse) score 305 or sacrifice child
[181560.198935] Out of memory: Kill process 7128 (chromium-browse) score 300 or sacrifice child
[181560.398301] Out of memory: Kill process 6823 (java) score 118 or sacrifice child
[181560.412076] Out of memory: Kill process 6855 (java) score 119 or sacrifice child
[181560.425394] Out of memory: Kill process 6859 (java) score 119 or sacrifice child

I described my issue on odroidx forum, but I fear it to be an environment issue. That's why I push a question in here. I have been building android from source with this computer for 6 months and never experienced such memory issues. In case it is useful, I use sun-java6:

$ dpkg --get-selections | grep java

$ uname -a
Linux xxx-ThinkPad-X220 3.0.0-17-generic #30-Ubuntu SMP Thu Mar 8 20:45:39 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

Has anyone experienced the same building android from source? What could be leaking in the java build?

share|improve this question

closed as off topic by mdpc, Michael Hampton, MDMarra, Sven, jscott Nov 15 '12 at 14:15

Questions on Server Fault are expected to relate to server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

If you're unhappy with the behavior of the OOM-Killer, disable it... – voretaq7 Nov 14 '12 at 21:35
Ahahah... I like your sense of humour. – m-ric Nov 14 '12 at 22:28
that was not a joke. The OOM killer is Bad Design, and violates the POSIX standard. Disable it, and the program that's requesting too much memory will die (when it can't get the RAM it wants) rather than this gang war drive-by collateral damage you're currently seeing. Then you can troubleshoot properly. – voretaq7 Nov 14 '12 at 22:32

It's not abnormal. I had this discussion before with someone building custom Android distros. You will need a lot more memory than 8 GB. IIRC they used a 32 GB ram machine.

share|improve this answer
Well, "I have been building android from source with this computer for 6 months and never experienced such memory issues". Also odroidx guys told me that: "Well, I never experienced that on [odroidx-android] BSP 3.1. I'm downloading the BSP 3.4 to test and let you know" – m-ric Nov 14 '12 at 22:26
I've also been told: My PC has 8GB as well and I havent saw the usage pass 4GB while building it – m-ric Nov 14 '12 at 22:38
@m-ric If it worked for you before and doesn't work now, What Changed? (obviously the answer isn't nothing, so work back through the changes and undo them until it works again :-) – voretaq7 Nov 14 '12 at 22:41
You're right to ask: the working android build comes from Google (official AOSP for pandaboard). The presumably faulty android build comes from Hardkernel. Two separate source trees... I have to merge odroid-x stuff into my aosp repo anyway. Thanks :-) – m-ric Nov 14 '12 at 22:47

Not the answer you're looking for? Browse other questions tagged or ask your own question.