java.lang.OutOfMemoryError:使用 NetBeans 的 Java 堆空间 [英] java.lang.OutOfMemoryError: Java heap space with NetBeans
问题描述
这是我在 NetBeans 启动的 Tomcat servlet 容器实例中运行 Web 应用程序时遇到的错误.为了解决这个问题,我什至更改了 netbeans.conf 中的堆大小,但它仍然显示相同的错误.我怎样才能避免这种情况发生?
<前>HTTP 状态 500 ---------------------------------------------------------------------------------输入异常报告信息说明 服务器遇到内部错误 (),阻止它完成此请求.例外javax.servlet.ServletException:Servlet 执行引发异常org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)根本原因java.lang.OutOfMemoryError:Java 堆空间注意 Apache Tomcat/5.5.9 日志中提供了根本原因的完整堆栈跟踪.在 netbeans.conf 中更改堆大小只会更改 NetBeans 本身的堆,而不是通过 NetBeans 运行的应用程序.
正确的方法是在项目上右击,选择属性",然后运行";在那里您可以适当地设置 VM 选项(例如,-Xmx256m
).它应该看起来像这样:
(感谢 VonC 找到这张图片.)
This is the error I get when I run my web application in an instance of the Tomcat servlet container started by NetBeans. To fix this I even changed the heap size in netbeans.conf, but still it shows the same error. How can I keep this from happening?
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.
Changing the heap size in netbeans.conf only changes the heap for NetBeans itself, not for applications run through NetBeans.
The correct way is to right-click on the project and select "Properties" and then "Run"; there you can set the VM options appropriately (-Xmx256m
, for instance). It should look something like this:
(Thanks to VonC for finding this picture.)
这篇关于java.lang.OutOfMemoryError:使用 NetBeans 的 Java 堆空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!