java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Java heap space

本文介绍了解决Java应用程序中出现的OutOfMemoryError问题的方法。通过调整内存设置并确保Tomcat和JDK版本一致来解决问题。

在写一个很简单的web项目时,出现了java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Java heap space错误,开始在网上查了查,说是把内存设置大一点,添加了一个环境变量,但是还是不行,后来又看到一篇文章上说的因为tomcat和jdk的版本不一致,打开myeclipse一看,果然,Tomcat 7.0和Myeclipse自带的jdk 6.0,把我自己的jdk 7.0加进来,换掉了jdk 6.0,成功了!

Myeclipse->preferences->MyEclipse->Servers->Tomcat->Tomcat7.X->JDK

.RELEASE/starling-metadata-sdk-foundation-4.2.3.0.RELEASE.jar!/com/huawei/it/publicsaas/miniapp/meta/service/impl/MiniAppMetaDataPrvAPIImpl.class]: Initialization of bean failed; nested exception is java.lang.OutOfMemoryError: Java heap space 2025-09-03 14:15:03 [Catalina-utility-1] ERROR ContainerBase:170 - Exception processing background thread java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Java heap space at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:1.8.0_302] at java.util.concurrent.FutureTask.get(FutureTask.java:192) ~[?:1.8.0_302] at org.apache.catalina.core.ContainerBase.threadStart(ContainerBase.java:1097) ~[tomcat-embed-core-9.0.108.jar:9.0.108] at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessorMonitor.run(ContainerBase.java:1141) ~[tomcat-embed-core-9.0.108.jar:9.0.108] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_302] at java.util.concurrent.FutureTask.runAndReset$$$capture(FutureTask.java:308) ~[?:1.8.0_302] at java.util.concurrent.FutureTask.runAndReset(FutureTask.java) ~[?:1.8.0_302] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) ~[?:1.8.0_302] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) ~[?:1.8.0_302] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_302] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_302] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:63) ~[tomcat-util-9.0.108.jar:9.0.108] at java.lang.Thread.run(Thread.java:748) ~[?:1.8.0_302] Caused by: java.lang.OutOfMemoryError: Java heap space
最新发布
09-04
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值