嵌入式 Tomcat 无法启动

Embedded Tomcat Would Not Start

我在 Jrebel 上 运行 Jhipster 项目时遇到了这个错误。我尝试通过将此行插入到 Arguments 选项卡上的 VM Argument 来增加我的 java 堆大小直到 512m,但无法解决错误。请问是什么原因导致错误,如何解决?

${jrebel_args}

-Xms512m -Xmx1024m

[ERROR] org.springframework.boot.context.embedded.tomcat.ServletContextInitializerLifecycleListener - Error starting Tomcat context: org.springframework.beans.factory.BeanCreationException
Exception in thread "main" 
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "main"
Exception in thread "process reaper" Exception in thread "process reaper" 

运行 带有 JRebel 的 JVM 将使用最多 50% 的内存,如果它使用更多则有问题。为了以防万一,请尝试使用 -Xmx2048m 将最大限制加倍。这必须避免 OutOfMemoryError 。之后可以在观察实际内存占用时减少。

我通过在 VM Arguments (eclipse) 添加 -XX:MaxPermSize=512m 来解决这个问题

感谢ZT(zeroturnaround)支持