Nougat-x86 - Jack-server (out of memory)

4,312 views
Skip to first unread message

Martin

unread,
Aug 27, 2016, 6:46:20 AM8/27/16
to Android-x86
Hi!

Today I've synced repo and everything is fine except the build error.

classes.dex.rsp
Out of memory error (version 1.2-rc4 'Carnac' (298900 f95d7bdecfceb327f9d201a1348397ed8a843843 by android-...@google.com)).
GC overhead limit exceeded.
Try increasing heap size with java option '-Xmx<size>'.
Warning: This may have produced partial or corrupted output.
[  0% 119/30763] build /media/marcin/b...IES/sdk_v12_intermediates/classes.jack
[  0% 119/30763] build /media/marcin/b...RIES/sdk_v5_intermediates/classes.jack
ninja: build stopped: subcommand failed.
make: *** [ninja_wrapper] Błąd 1
marcin@marcin-B85M-D3H:~/nougat-x86$
marcin@marcin-B85M-D3H:~/nougat-x86$

https://source.android.com/source/jack.html
Android site says, that I should lower the NB_COMPILE variable(eg. from 4 to 1). Except the slower building - nothing has changed...
Try increasing heap size with java option '-Xmx<size>'.

Yes, I've done it too.
From this:
JACK_VM_COMMAND=${JACK_VM_COMMAND:=java}
To this:
JACK_VM_COMMAND=${JACK_VM_COMMAND:=java -Xmx5G}
 
 And I still receive out of memory error.

What's going on?

Thanks!

Huihong Luo

unread,
Aug 27, 2016, 12:13:41 PM8/27/16
to Android-x86
Make sure you restart jack server after changing the env Var. I did the similar thing, and it worked. I am using oracle jdk 8 though.

Huihong Luo

unread,
Aug 27, 2016, 12:17:12 PM8/27/16
to Android-x86

Martin

unread,
Aug 27, 2016, 12:25:32 PM8/27/16
to Android-x86


W dniu sobota, 27 sierpnia 2016 18:17:12 UTC+2 użytkownik Huihong Luo napisał:
More info here:

http://stackoverflow.com/questions/35579646/android-source-code-compile-error-try-increasing-heap-size-with-java-option


Thanks! I've tried this already - doesn't work at all.
I've probably found a great solution... in $PROJECT_HOME/prebuilts/sdk/tools/jack-admin - on 454 line there's startup cmd... I've added a -Xmx6G variable... and till now everything is fine(I'm building right now).


dgdn

unread,
Aug 27, 2016, 1:49:38 PM8/27/16
to Android-x86
no such issue here, Ubuntu 16.04 LTS, android-x86_64 built correctly as of 8-25.....

$ update-alternatives --config java
There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                            Priority   Status
------------------------------------------------------------
* 0            /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java   1081      auto mode
  1            /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java   1071      manual mode
  2            /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java   1081      manual mode

Mauro Rossi

unread,
Aug 28, 2016, 2:23:09 PM8/28/16
to Android-x86
Hi, 
with jack server version used in android 7.0 it is possible to reduce the number of concurrent services N in file  $HOME/.jack-server/config.properties 

jack.server.max-service=N

but setting the -Xmx variable in an effective way is much better.
Thanks

Mauro

Geek Till It Hertz

unread,
Aug 31, 2016, 4:22:23 PM8/31/16
to Android-x86
try
export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4096m"
out/host/linux-x86/bin/jack-admin kill-server
out/host/linux-x86/bin/jack-admin start-server

Martin

unread,
Aug 31, 2016, 5:56:18 PM8/31/16
to Android-x86
try
export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4096m"
out/host/linux-x86/bin/jack-admin kill-server
out/host/linux-x86/bin/jack-admin start-server

Hmm, worked. But not permanently. Anyway... editing the jack-admin file was the best solution.
I saw, that more people have this problem already... Weird. Idk, what they changed, but all settings are moved to "config.properties". That's why these variables aren't working...

Issue is solved. Thanks for help!

Geek Till It Hertz

unread,
Aug 31, 2016, 9:28:41 PM8/31/16
to Android-x86
Btw can i have the cpu and ram config. You are using?
I have an i3 with 8gb of ram.
An i7 with 16 gigs of ram does not have this issue AFAIK.

zhongtian xie

unread,
Sep 1, 2016, 10:20:48 AM9/1/16
to andro...@googlegroups.com
it seem to be some explicty!  maybe you can try to use docker build different version and avoid switch jdk version!!


--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-x86+unsubscribe@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-x86.
For more options, visit https://groups.google.com/d/optout.

Martin

unread,
Sep 1, 2016, 10:38:42 AM9/1/16
to Android-x86

Btw can i have the cpu and ram config. You are using?
I have an i3 with 8gb of ram.
An i7 with 16 gigs of ram does not have this issue AFAIK.

I use Intel(R) Core(TM) i5-4690K CPU @ 3.50GHz. Overclocked a bit. And Kingston HyperX fury 8GB 1600. Midrange self-builded computer :)
Anyway... this error appears because of Java. Without any flags - java takes only ~40%(max) of memory... (in my case). If I'd had more RAM(16GB) ... the 40% would be 2 times higher, isn't it?

When I'm trying to find good java start command - for max preformance - I'm searching for "Minecraft server start.sh". Really - unbeliveable how fast java can work.

dgdn

unread,
Sep 1, 2016, 11:29:45 AM9/1/16
to Android-x86
are you trying to build within the limits???

does m -j2 iso_img work??
         m -j4 iso_img work??
         m -j6 iso_img work??
         m -j8 iso_img work??

are you exceeding these limits and that's when you get jack-server issues????

if so good luck with that, I can break mine every time by doing something like
m -j 24 iso_img....so I've learned to stay withing the limits of my processor being used!!

Geek Till It Hertz

unread,
Sep 1, 2016, 12:11:56 PM9/1/16
to Android-x86
Bingo!
Reply all
Reply to author
Forward
0 new messages