Android Studio 1.5.1 - 无法增加 Java 堆大小

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

我正在使用 Windows 7 64 位,我尝试了很多与我的主题相似的答案的解决方案,但没有运气..

将以下行添加到您的 gradle.properties 文件中:

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

例如,如果您将以上行添加到新创建的 Android Studio 1.5.1 项目的 gradle.properties 文件中,您将拥有:

# 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