2017-01-26 10 views
0

このエラーに関するその他の質問をすべて読んで解決しましたが、役に立たないです。ここでjava.lang.OutOfMemoryError:GCオーバヘッドの上限を超えてアンドロイドスタジオ

は私がJDKをアンインストールしてから再インストールして試してみましたのAndroid Studioの2.1.3のAndroid Studioの2.2.3 上でそれを試してみましたが、私のbuild.gradle

apply plugin: 'com.android.application' 
apply plugin: 'android-apt' 
apply plugin: 'io.fabric' 



android { 
    compileSdkVersion 23 
    buildToolsVersion '23.0.3' 
    defaultConfig { 
     applicationId "zebrostudio.wallr100" 
     minSdkVersion 17 
     targetSdkVersion 23 
     renderscriptTargetApi 22 
     renderscriptSupportModeEnabled true 
     //apply plugin: 'application' 
     versionCode 5 
     versionName "5.0" 
     multiDexEnabled true 
     ndk { 
      abiFilters "armeabi", "armeabi-v7a", "x86", "mips" 
     } 
     dexOptions { 
      preDexLibraries = true 
      incremental true 
      javaMaxHeapSize "4g" 
     } 
    } 
    buildTypes { 
     release { 
      debuggable false 
      minifyEnabled true 
      proguardFiles 'proguard-rules.pro' 
     } 
     debug { 
      minifyEnabled false 
      proguardFiles 'proguard-rules.pro' 
     } 
    } 
} 

dependencies { 
    compile project(':library') 
    compile project(':library:altex') 
    compile project(':library:ucrop') 
    compile project(path: ':library') 
    compile 'com.android.support:recyclerview-v7:23.4.0' 
    compile 'com.android.support:appcompat-v7:23.4.0' 
    compile 'com.android.support:support-v4:23.4.0' 
    compile 'com.ogaclejapan.smarttablayout:library:[email protected]' 
    compile 'com.squareup.retrofit2:retrofit:2.1.0' 
    compile 'com.squareup.retrofit2:converter-gson:2.1.0' 
    compile 'com.github.bumptech.glide:glide:3.7.0' 
    compile 'com.ogaclejapan.smarttablayout:utils-v4:[email protected]' 
    compile 'com.google.code.gson:gson:2.6.2' 
    compile 'com.android.support:design:23.4.0' 
    compile 'jp.wasabeef:recyclerview-animators:2.2.3' 
    compile 'com.github.clans:fab:1.6.4' 
    compile 'com.bignerdranch.android:simple-item-decoration:1.0.0' 
    compile 'de.hdodenhof:circleimageview:2.1.0' 
    compile 'com.github.chrisbanes:PhotoView:1.3.0' 
    compile 'com.github.hotchemi:permissionsdispatcher:2.1.3' 
    apt 'com.github.hotchemi:permissionsdispatcher-processor:2.1.3' 
    compile 'com.eightbitlab:blurview:1.1.2' 
    compile 'uk.co.chrisjenx:calligraphy:2.2.0' 
    compile 'com.google.firebase:firebase-core:10.0.1' 
    compile 'com.google.firebase:firebase-messaging:10.0.1' 
    compile 'com.google.firebase:firebase-ads:10.0.1' 
    compile fileTree(include: ['*.jar'], dir: 'wallr100') 
    compile 'com.android.support:multidex:1.0.1' 
    compile('com.crashlytics.sdk.android:crashlytics:[email protected]') { 
     transitive = true; 
    } 
    compile 'com.bignerdranch.android:recyclerview-multiselect:0.2' 
    compile 'fr.tvbarthel.blurdialogfragment:lib:2.2.0' 
    compile 'com.afollestad:drag-select-recyclerview:0.3.6' 
    compile 'com.afollestad:material-cab:0.1.12' 
    compile project(':lowpoly') 
    compile 'info.hoang8f:fbutton:1.0.5' 
    compile project(':librarySecuredPref') 
    compile 'com.jakewharton:process-phoenix:1.1.0' 
    compile 'com.github.ybq:Android-SpinKit:1.1.0' 
    compile 'com.getkeepsafe.taptargetview:taptargetview:1.5.1' 
    compile project(':librarySearch') 
    compile 'com.github.recruit-lifestyle:WaveSwipeRefreshLayout:1.6' 
    compile 'com.google.android.gms:play-services:10.0.1' 
} 

apply plugin: 'com.google.gms.google-services' 

です。 私はウィンドウをフォーマットして再試行しましたが、無駄です。私はjava.lang.OutOfMemoryErrorを取得し続ける

It creates so many background processes and the computer starts slowing down.

:GCオーバーヘッドの制限は、私はこの問題を解決するにはどうすればよいのエラー

を超えましたか?

+0

まず、このOutOfMemoryErrorを取得したときに、Android Studioを起動したとき、シミュレータでアプリケーションを実行しているとき、Gradleを実行しているとき、第2に、OOMEは、いわゆるヒープスペースを使い果たしたJavaアプリケーションです。そのため、単純に言えば、Javaプログラムの中には、割り当てられているよりも多くのメモリを使用する必要があります。あなたはどんなプログラムであるかを理解することをお勧めします。 –

+0

プロジェクトの構築はうまくいきます。この問題は、自分の携帯電話に展開しようとしているときに発生します。 –

答えて

0

私はそれを自分で修正しました。問題は、私が使用していた依存関係の数を減らしたときに解決されました。したがって、この問題に直面している人は、使用しているライブラリの数を減らしてみてください。

0

さらなる解決策は、使用するgradleファイルです。私はgradle.propertiesファイルでエラーを克服しました。プロジェクトに存在しない場合は、project levelにファイルを作成する必要があります。 Gradleはデフォルトで1024mのメモリを使用します。あなたは1536mまで増やすことができます(16gのメモリがあるので私は2048mでした)。私はそれをした後でエラーを起こさない。

関連する問題