android - Error:java.lang.OutOfMemoryError: GC overhead limit exceeded error on Telegram -


i'm newbie android , trying run telegram source code provided on github android faced terrible errors , after days of googling found nothing @ all!

i followed instructions it's not working. error say's error:java.lang.outofmemoryerror: gc overhead limit exceeded after increasing max heap size it's throwing same error more memory.

buildvars.java:

public class buildvars {     public static boolean debug_version = false;     public static int build_version = 821;     public static string build_version_string = "3.10";     public static string app_hash = "94706fdc9f5d86e2c3749bd8d0a2559e"; //obtain own app_hash @ https://core.telegram.org/api/obtaining_api_id     public static string hockey_app_hash = "f7a81fd2b9cd40d3a8687311defcfe88";     public static string hockey_app_hash_debug = "f7a81fd2b9cd40d3a8687311defcfe88";     public static string gcm_sender_id = "760348033672";     public static string send_logs_email = "ssiasoft@gmail.com";     public static string bing_search_key = "afb6312cb4ed4e78b8dfd177c6d174af"; //obtain own key @ https://www.bing.com/dev/en-us/dev-center     public static string foursquare_api_key = "hnrphathvhebkxmvvlntyxogguhpusgvmb33tp2xnofwmggv"; //obtain own key @ https://developer.foursquare.com/     public static string foursquare_api_id = "a9abcd"; //obtain own api_id @ https://developer.foursquare.com/     public static string foursquare_api_version = "20150326"; } 

and here's full error message log:

:tmessagesproj:transformclasses_enhancedwithinstant+reloaddexforarmdebug up-to-date :tmessagesproj:incrementalarmdebugtasks :tmessagesproj:prepackagemarkerforarmdebug :tmessagesproj:fastdeployarmdebugextractor :tmessagesproj:generatearmdebuginstantrunappinfo :tmessagesproj:transformclasseswithdexforarmdebug run dex in process, gradle daemon needs larger heap. has approximately 910 mb. faster builds, increase maximum heap size gradle daemon more 2048 mb. set org.gradle.jvmargs=-xmx2048m in project gradle.properties. more information see https://docs.gradle.org/current/userguide/build_environment.html error:unexpected top-level error: error:java.lang.outofmemoryerror: gc overhead limit exceeded :tmessagesproj:transformclasseswithdexforarmdebug failed error:execution failed task ':tmessagesproj:transformclasseswithdexforarmdebug'. > com.android.build.api.transform.transformexception: java.lang.runtimeexception: com.android.ide.common.process.processexception: java.util.concurrent.executionexception: com.android.ide.common.process.processexception: org.gradle.process.internal.execexception: process 'command 'c:\program files\java\jdk1.8.0_40\bin\java.exe'' finished non-zero exit value 3 information:build failed information:total time: 13 mins 5.264 secs information:3 errors information:0 warnings 

any 1 knows why happens , how make run?

and i'll grateful has working telegram project sharing code me.

problem

as it's said in log message, gradle needs more memory because uses dex in process feature.

to run dex in process, gradle daemon needs larger heap. has approximately 910 mb. faster builds, increase maximum heap size gradle daemon more 2048 mb.to set org.gradle.jvmargs=-xmx2048m in project gradle.properties.

gradle written in java, , other java program amount of memory has limited heap size.

heapsize, stacksize , garbage collection fundamentals

solution

option 1 - increase heap size

to increase heap size, increase maximum available amount of heap - set jvm option -xmx. try setting 2gb log message suggests: -xmx2048m. in gradle, it's done writing org.gradle.jvmargs=-xmx2048m in project gradle.properties. file located next build.gradle. if doesn't, create 1 manually.

after that, if error persists, try explicitly tell dex in process feature how memory has - add build.gradle (app module). note, should smaller total amount of memory available gradle, i.e. if gradle has 2gb, set 1gb dex in process:

android {  ....  dexoptions {     // prevent outofmemory     javamaxheapsize "1g"   } } 

try bigger values, actual values depend on project.

option 2 - turn off dex in process feature

although builds said slower without feature, try turning off.

android {     // ...     dexoptions {         dexinprocess = false     } } 

Comments

Popular posts from this blog

amazon web services - S3 Pre-signed POST validate file type? -

c# - Check Keyboard Input Winforms -