4

I've just learned a new way to set jvm heap size instead of settings in gradle.properties using org.gradle.jvmargs=-Xmx4608M is setting in app/build.gradle:

dexOptions {
        javaMaxHeapSize "6g"
}

But I want to know what are the differences between this and android:largeHeap="true" in AndroidManifest.xml.

Thank you!

nhoxbypass
  • 9,695
  • 11
  • 48
  • 71
  • 1
    have look [android:largeHeap="true"](https://stackoverflow.com/questions/27396892/what-are-advantages-of-setting-largeheap-to-true) and [javaMaxHeapSize](https://stackoverflow.com/questions/33750404/android-gradle-what-is-javamaxheapsize-4g) – Hemant Parmar Feb 21 '18 at 04:36

1 Answers1

4

JavaMaxHeapSize: the heap size for the dex process, It is for speeding up the build gradle

LargeHeap: Most apps should not need this and should instead focus on reducing their overall memory usage for improved performance. Enabling this also does not guarantee a fixed increase in available memory, because some devices are constrained by their total available memory. It is for allocating more memory to run application on RAM.

JavaMaxHeapSize: https://hackernoon.com/speed-up-gradle-build-in-android-studio-80a5f74ac9ed

LargeHeap:https://developer.android.com/guide/topics/manifest/application-element.html

Asutosh Panda
  • 1,463
  • 2
  • 13
  • 25
SahdevRajput74
  • 754
  • 7
  • 18