Please use the solution provided here:

https://stackoverflow.com/questions/60468693/java-outofmemoryerror-when-building-aosp-10/60474592#60474592

It worked for me. I used m -j1 to be on the safer side. 

On Tuesday, May 15, 2018 at 8:53:55 PM UTC+5:30 [email protected] wrote:

> Well I have been compiling roms on 4gb system with 8gb swap.
> I also had problem with jack.
> So before compiling do this
> As you said you have decreased service to 1, so it's fine.
> then
> # Stop the jack server if running
> jack-admin stop-server
> # If you are starting jack manually then
>
> JACK_SERVER_VM_ARGUMENTS="-Xmx2g -Dfile.encoding=UTF-8 
> -XX:+TieredCompilation" /path/to/jack-admin start-server
>
>
> #If you use the jack server in the android tree then
>
> export ANDROID_JACK_VM_ARGS="-Xmx2g -Dfile.encoding=UTF-8 
> -XX:+TieredCompilation
>
> If this doesn't work change the -Xmx2g to -Xmx4g, increase it if it 
> doesn't work

-- 
-- 
You received this message because you are subscribed to the "Android Building" 
mailing list.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-building/455858f7-135c-4b13-9024-ab7e317bb05cn%40googlegroups.com.

Reply via email to