Tuesday 23 January 2018

Android AOSP Nougat Build and Jack "Out of Memory" issue resolution.

I had downloaded Android Nougat before and had failed miserably with Jack. It used to always give me a "Out of memory" error. I have an Intel Quad Core Q8200 2.33GHz laptop with 4GB of RAM.

Looking around I found a post by Chris Simmonds in his blog which said which says to increase the memory  using the JACK_SERVER_VM_ARGUMENTS environment variable. I set the following value in my ~/.jack_settings i.e. max memory to 3GB:

1
JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx3g"
 
While compilation I still had problems with JACK Server having communication problems. I further reduced the JACK compile jobs to by setting the SERVER_NB_COMPILE=1 in ~/.jack_settings.

Please see reference 3 where the Google documentation for JACK is updated and it details on different parameters JACK.

I am not sure whether the problem was resolved by installing
ibcurl4-openssl-dev and nss-updatedb packages but it is worth to give a try.

After this I was able to completely build Nougat and boot it up using my emulator. The final aim is to understand how to boot Nougat on the Beaglebone.

Reference:
  1. Chris simmonds post: http://www.2net.co.uk/blog/jack-server.html
  2. Google groups post: https://groups.google.com/forum/#!topic/android-building/8SQ0-4zZDo8
  3. Google Gerrit Jack Documentation change: https://android-review.googlesource.com/c/platform/prebuilts/sdk/+/233481

No comments:

Post a Comment