2015年6月8日月曜日

Could not reserve enough space for object heap

以前下記のような趣旨のエラーが出たように記憶しており、その回避のために、Android Studio>File>Settings>Build Tools>Compiler>VM Options欄にheapサイズを大きくすべく -Xmx????m などと書いた。
しかしながら、また、下記のエラーが出た。今回は、VM Options欄を空欄にしてみた。そうすれば、エラーは無くなった。むむむ!

そして、その後また同様のエラーが発生した。
-Xmx512m と書くとエラーが無くなった。数値が大きければ良いというものでは無いらしい。

Error: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 http://gradle.org/docs/2.2.1/userguide/gradle_daemon.html
Please read the following 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.


その後、Android Studioが1.3になると、VM Options欄が消失していた。いままでの苦労はなんだったんだろうか。

2015/08/08 また出てしまった。
Error:Unable to start the daemon process: could not reserve enough space for object heap.
Please assign more memory to Gradle in the project's gradle.properties file.
For example, the following line, in the gradle.properties file, sets the maximum Java heap size to 1,024 MB:
Windowsを再起動したり、Android Studioを再起動したりすると、このエラーは消える。むむむ!

2015/08/13 また出てしまった。Android Studio 1.3.1
Error:Unable to start the daemon process: could not reserve enough space for object heap.
Please assign more memory to Gradle in the project's gradle.properties file.
For example, the following line, in the gradle.properties file, sets the maximum Java heap size to 1,024 MB:
org.gradle.jvmargs=-Xmx1024m

2015/08/27 また同じのが出てしまった。Android Studio 1.3.2
Error:Unable to start the daemon process: could not reserve enough space for object heap.
Please assign more memory to Gradle in the project's gradle.properties file.
For example, the following line, in the gradle.properties file, sets the maximum Java heap size to 1,024 MB:
org.gradle.jvmargs=-Xmx1024m
Windowsを再起動すれば直るため、このエラーメッセージの内容は参考程度ですね。

2016/01/05 Android Studio 1.5.1
この問題は、Android Studio の問題では無く、Windowsが発生させているようです。
上記のように、オプション欄にいろいろ数値を代入していじくっても解決しません。
よく発生するのは、Windowsのシステムアップデートの時です。事前に、Windowsのシステムアップデートをしっかり定着させておきましょう。
それでも、本日は、頻繁に発生してしまいました。Windowsのいわゆる「起動マネージャ」を使い、Windowsの起動時に起動されてしまうアプリを見直してみましょう。私の場合、この確認行為をしただけで、実際には何も変更を加えていないにも関わらず、Android studioの問題が消失しました。むむむ。