Android studio 2.0 Preview 8 with gradle plugin 2.0.0-alhpa8, memory warning despite heap size to 4Gb -


i updated android studio version 2.0 preview 8 , gradle plugin 2.0.0-alpha8. noticed there's warning in case heap space not big enough dexing.

as in proper page (http://tools.android.com/recent)

in 2.0.0-alpha8 we've added automatic diagnostics this: if build process small, switch out-of-memory dexing , emit build warning explaining how bump gradle daemon size. (we're working on additional related improvements next build after alpha8.)

when went building project got following error:

to run dex in process, gradle daemon needs larger heap. has 3641 mb. faster builds, increase maximum heap size gradle daemon more 4g specified in dexoptions.javamaxheapsize. this, set org.gradle.jvmargs=-xmx4g specified in dexoptions.javamaxheapsize in project gradle.properties. more information see https://docs.gradle.org/current/userguide/build_environment.html

actually, lot of these in row. surprises me because that's see in gradle.properties file (in project home dir)

android_build_target_sdk_version=23 android_build_tools_version=23 android_build_sdk_version=23 android_build_min_sdk_version=16 org.gradle.jvmargs=-xmx4g -xx:maxpermsize=4096m -xx:+heapdumponoutofmemoryerror -dfile.encoding=utf-8 

also, in build.gradle of main module, put

android {     dexoptions {         incremental true         javamaxheapsize "4g"     } } 

so don't understand builder/dexer/compiler getting 3641mb value.

builds extremely slow

i disabled instant run , things faster. 48-50 seconds build. still same error once , not many times in row.

i'm on linux, ulimit -a following:

core file size          (blocks, -c) 0 data seg size           (kbytes, -d) unlimited scheduling priority             (-e) 0 file size               (blocks, -f) unlimited pending signals                 (-i) 31483 max locked memory       (kbytes, -l) 64 max memory size         (kbytes, -m) unlimited open files                      (-n) 1024 pipe size            (512 bytes, -p) 8 posix message queues     (bytes, -q) 819200 real-time priority              (-r) 0 stack size              (kbytes, -s) 8192 cpu time               (seconds, -t) unlimited max user processes              (-u) 31483 virtual memory          (kbytes, -v) unlimited file locks                      (-x) unlimited 

also, studio.vmoptions file: https://gist.github.com/markco/1ae7918daf867a378a2f guess it's unedited. have custom one, don't know be.

i got solved, or seems. last change had made before posted question following:

i had

android_build_target_sdk_version=22 android_build_tools_version=22 android_build_sdk_version=22 android_build_min_sdk_version=16 org.gradle.jvmargs=-xmx4g -xx:maxpermsize=4096m -xx:+heapdumponoutofmemoryerror -dfile.encoding=utf-8 

and changed to

android_build_target_sdk_version=23 android_build_tools_version=23 android_build_sdk_version=23 android_build_min_sdk_version=16 org.gradle.jvmargs=-xmx4g -xx:maxpermsize=4096m -xx:+heapdumponoutofmemoryerror -dfile.encoding=utf-8 

i don't know why wasn't changed automatically, since i've been using 23 target version long time. anyways, after changed 22 23 didn't have builds yet, seemed due gradle sync still running in background. killed gradle projects, kept version 23 in place of 22, disabled instant run , performed new synchronization. @ first kept seing "to run dex in process, gradle daemon needs larger heap." error, 1 time , not repeated happened before. build after build saw build times getting lower, until got 10 seconds build. guess it's solved. hope, @ least.

p.s. in end changed maxpermsize accordingly henry said, configuration is

android_build_target_sdk_version=23 android_build_tools_version=23 android_build_sdk_version=23 android_build_min_sdk_version=16 org.gradle.jvmargs=-xmx4g -xx:maxpermsize=512m -xx:+heapdumponoutofmemoryerror -dfile.encoding=utf-8 

Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -