eclipse 启动tomcat报错 java.lang.OutOfMemoryError: Java heap space

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了eclipse 启动tomcat报错 java.lang.OutOfMemoryError: Java heap space相关的知识,希望对你有一定的参考价值。

java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOfRange(Unknown Source)
at java.lang.String.<init>(Unknown Source)
at java.lang.StringBuffer.toString(Unknown Source)
at java.io.StringWriter.toString(Unknown Source)
at java.util.logging.SimpleFormatter.format(Unknown Source)
at java.util.logging.StreamHandler.publish(Unknown Source)
at java.util.logging.ConsoleHandler.publish(Unknown Source)
at java.util.logging.Logger.log(Unknown Source)
at java.util.logging.Logger.doLog(Unknown Source)
at java.util.logging.Logger.logp(Unknown Source)
at org.apache.juli.logging.DirectJDKLog.log(DirectJDKLog.java:167)
at org.apache.juli.logging.DirectJDKLog.error(DirectJDKLog.java:135)
at org.apache.catalina.core.ApplicationContext.log(ApplicationContext.java:673)
at org.apache.catalina.core.ApplicationContextFacade.log(ApplicationContextFacade.java:271)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1209)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4149)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4458)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
... 6 more
已经修改了catalina.bat里set JAVA_OPTS=-Xms64m -Xmx256m

内存泄露了,你电脑多大内存的?参数在jre上设置比较管用,其他的什么改tomcat参数啊,eclipse设置啊我都用过不太管用。
window-preferences-java-install jres 当前jre版本-edit--default VM arguments加上这句
-Xms800m -Xmx800m -XX:MaxNewSize=256m -XX:MaxPermSize=256m

这么搞。追问

公司小破本 2G内存 好 我试试

参考技术A 是不是物理内存用尽了,用资源管理器看看内存使用情况追问

物理内存73%

参考技术B 内存溢出?追问

怎么解决呢?

以上是关于eclipse 启动tomcat报错 java.lang.OutOfMemoryError: Java heap space的主要内容,如果未能解决你的问题,请参考以下文章

eclipse 的 tomcat 启动报错(Server Tomcat v7.0 Server at localhost failed to start.)

Eclipse启动tomcat时出现报错

Tomcat 启动项目报错 java.lang.OutOfMemoryError: Java heap space

eclipse中安装并配置好TOMCAT后,点击启动按钮没有任何反应,也不报错 是啥问题

tomcat单独启动成功, eclipse启动tomcat报错, 错误一:找不到或无法加载主类 org.apache.catalina.startup.Bootstrap;错误二:端口被占用

tomcat启动报错了,求教高手解答