Play Framework – 无法为对象堆保留足够的空间
我对我的游戏项目进行了一些修改,当我尝试运行它时,我得到了错误。
>play run 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 occured. Program will exit.
这是个常见的问题吗? 我对游戏框架相当缺乏经验,但我之前已多次运行我的项目而没有遇到此错误。
编辑:有关java版本的信息。
>java -version java version "1.7.0_11" Java(TM) Runtime Environment (build 1.7.0_11-b21) Java HotSpot(TM) Client VM (build 23.6-b04, mixed mode, sharing)
在Play framework 2.0.3中,
脚本需要替换下面命令的命令行参数
java -Xms512M -Xmx1024M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256M %DEBUG_PARAM% -Dfile.encoding=UTF8 -Dplay.version="%PLAY_VERSION%" -Dsbt.ivy.home="%~dp0..\repository" -Dplay.home="%~dp0." -Dsbt.boot.properties="file:///%p%sbt/sbt.boot.properties" -jar "%~dp0sbt\sbt-launch.jar" %*
成
java -XX:+CMSClassUnloadingEnabled %DEBUG_PARAM% -Dfile.encoding=UTF8 -Dplay.version="%PLAY_VERSION%" -Dsbt.ivy.home="%~dp0..\repository" -Dplay.home="%~dp0." -Dsbt.boot.properties="file:///%p%sbt/sbt.boot.properties" -jar "%~dp0sbt\sbt-launch.jar" %*
它解决了我的问题。
有关更多信息,请参阅此文章 。