这是我在 NetBeans 启动的 Tomcat servlet 容器实例中运行我的 Web 应用程序时遇到的错误。为了解决这个问题,我什至更改了 netbeans.conf 中的堆大小,但它仍然显示相同的错误。我怎样才能避免这种情况发生?
HTTP Status 500 - -------------------------------------------------------------------------------- type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException: Servlet execution threw an exception org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362) root cause java.lang.OutOfMemoryError: Java heap space note The full stack trace of the root cause is available in the Apache Tomcat/5.5.9 logs.
最佳答案
在 netbeans.conf 中更改堆大小只会更改 NetBeans 本身的堆,不会更改通过 NetBeans 运行的应用程序。
正确的方法是右击项目,选择“属性”,然后选择“运行”;在那里您可以适本地设置 VM 选项(例如 -Xmx256m
)。它应该看起来像这样:
(感谢 VonC 找到这张图片。)
关于java.lang.OutOfMemoryError : Java heap space with NetBeans 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/717550/