我在 IntelliJ 中为我的项目运行一个 grails 应用程序,我已将 vm 选项设置为:
-Dserver.port=8080 -Xms3g -Xmx3g -XX:-UseGCOverheadLimit -Xverify:none
日志是:
Running Grails application
Invalid maximum heap size: -Xmx4096M
The specified size exceeds the maximum representable size.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Error | Forked Grails VM exited with error
请帮我解决这个问题?
最佳答案
我没有机会写评论,所以我直接写答案。
如果您的 JVM 是 32 位的,那么堆大小应该小于 4gb。您可以安装 64 位 JVM,或者使用 -Xmx2048M
将最大堆空间设置为 2GB。我遇到了类似的问题,这对我有用,希望这对你也有帮助
关于java - 最大堆大小无效?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62386842/