我正在使用Windows 7 64位,我尝试了很多类似于我的主题的解决方案,但没有运气..
答案 0 :(得分:2)
将以下行添加到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