zoukankan      html  css  js  c++  java
  • tomcat内存溢出的解决方法(java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError:)

     

    报错信息如下:
    
    严重: Error waiting for multi-thread deployment of directories to completehostConfig.deployWar=Deploying web application archive {0}
    
    java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: PermGen spaceat java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)at java.util.concurrent.FutureTask.get(FutureTask.java:83)at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1018)at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:473)at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1412)at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:312)at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:401)at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:346)at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1117)at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:782)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1525)at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1515)at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)at java.util.concurrent.FutureTask.run(FutureTask.java:138)at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)at java.lang.Thread.run(Thread.java:619)Caused by: java.lang.OutOfMemoryError: PermGen spaceat java.lang.ClassLoader.defineClass1(Native Method)at java.lang.ClassLoader.defineClass(ClassLoader.java:621)at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2823)at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1160)at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1655)at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1533)at org.apache.catalina.startup.ContextConfig.checkHandlesTypes(ContextConfig.java:1988)at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:1951)at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1840)at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1808)at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1794)at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1214)at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:828)at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:302)at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5148)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:866)at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:842)at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1095)at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1617)at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    
    ... 5 more

     

     

    在网上查自资料才知道原来是我的项目中引入了大量的第三方架包所导致的。

    最简单的解决办法:

      eclipse中,window-->preferences-->Java-->Installed JREs

      选中JRE 点击Edit

    写入这句话:

    -Xms800m -Xmx800m -XX:MaxNewSize=256m -XX:MaxPermSize=256m

     

  • 相关阅读:
    RabbitMQ系列教程之七:RabbitMQ的 C# 客户端 API 的简介
    RabbitMQ系列教程之六:远程过程调用(RPC)
    git无法提交,存在未提交的修改,在重新合并前或者撤销更改
    安装mysql提示3306端口已经被占用解决方案
    区块链学习一基本知识
    超级账本 --- ReadWriteSet的逻辑结构
    解决windows10 里vs2015 附件进程调试提示“此任务要求应用程序有提升的权限”
    Fabric V1 交易的生命周期
    sql 取首次投资的人
    Win10年度更新开发必备:VS2015 Update 3正式版下载汇总
  • 原文地址:https://www.cnblogs.com/smile361/p/2653893.html
Copyright © 2011-2022 走看看