Search code examples
javaandroidandroid-studiosizeheap-memory

Android Studio 1.5.1 - Can't increase the Java heap size


i am using Windows 7 64 bit, i tried lots of solutions from the answers that are similar to my topic, but no luck..

Android Studio error message


Solution

  • Add the following line to your gradle.properties file:

    org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m
    

    For example, if you add the above line to a newly-created Android Studio 1.5.1 project's gradle.properties file, you would have:

    # Project-wide Gradle settings.
    
    # IDE (e.g. Android Studio) users:
    # Gradle settings configured through the IDE *will override*
    # any settings specified in this file.
    
    # For more details on how to configure your build environment visit
    # http://www.gradle.org/docs/current/userguide/build_environment.html
    
    # Specifies the JVM arguments used for the daemon process.
    # The setting is particularly useful for tweaking memory settings.
    # Default value: -Xmx10248m -XX:MaxPermSize=256m
    # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
    
    # When configured, Gradle will run in incubating parallel mode.
    # This option should only be used with decoupled projects. More details, visit
    # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
    # org.gradle.parallel=true
    
    org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m