しおしお

IntelliJ IDEAのことなんかを書いてます

JetGradleのリフレッシュでメモリ関連のエラーが出た場合の対処方法

JetGraidleのリフレッシュで以下エラーが出た場合の対処方法。

Refresh failed:
         Could not fetch model of type 'IdeaProject' using Gradle installation 'D:\gradle-1.4'.
         Unable to start the daemon process.
         This problem might be caused by incorrect configuration of the daemon.
         For example, an unrecognized jvm option is used.
         Please refer to the user guide chapter on the daemon at D:\gradle-1.4\docs\userguide\gradle_daemon.html
         Please read below process output to find out more:
         -----------------------
         Error occurred during initialization of VM
         Could not reserve enough space for object heap
         Error: Could not create the Java Virtual Machine.
         Error: A fatal exception has occurred. Program will exit.
解決方法

gradle.propertiesに以下設定を追加する。

org.gradle.jvmargs= -Xmx512m

ユーザホームに「gradle.properties」をおいておけば、全てのプロジェクトに適用されるので、毎回設定する必要がなくなります。