java.lang.OutOfMemoryError:使用NetBeans的Java堆空间 [英] java.lang.OutOfMemoryError: Java heap space with NetBeans
问题描述
这是我在NetBeans启动的Tomcat servlet容器实例中运行Web应用程序时遇到的错误。为了解决这个问题,我甚至改变了netbeans.conf中的堆大小,但它仍然显示相同的错误。如何防止这种情况发生?
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.
推荐答案
在netbeans.conf中更改堆大小只会更改NetBeans本身的堆,而不是应用程序通过NetBeans运行。
Changing the heap size in netbeans.conf only changes the heap for NetBeans itself, not for applications run through NetBeans.
正确的方法是右键单击项目并选择属性,然后选择运行;在那里你可以适当地设置VM选项(例如, -Xmx256m
)。它看起来应该是这样的:
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:
(感谢 VonC 查找此图片。)
这篇关于java.lang.OutOfMemoryError:使用NetBeans的Java堆空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!