gc overhead limit exceeded eclipse

Eclipse will throw GC overhead limit exceeded error when it runs out of memory, normally while performing memory-consuming operations such as building workspace on big projects.

- See more at: http://docs.oseems.com/general/application/eclipse/fix-gc-overhead-limit-exceeded#sthash.VO6sefn8.dpuf


"if too much time is being spent in garbage collection: if more than 98% of the total time is spent in garbage collection and less than 2% of the heap is recovered, an OutOfMemoryError will be thrown."

jvm gc行为中超过98%以上的时间去释放小于2%的堆空间时会报这个错误。

http://docs.oseems.com/general/application/eclipse/fix-gc-overhead-limit-exceeded


另一种处理方法:

在jvm启动参数中添加 "-XX:-UseGCOverheadLimit",该参数在JDK6中默认启用("-XX:+UseGCOverheadLimit")。

  调整后的生产环境中使用的参数为:   

JAVA_OPTS='-Xms512m -Xmx4096m -XX:MaxPermSize=128m -XX:-UseGCOverheadLimit -XX:+UseConcMarkSweepGC' 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
当在使用Eclipse的Build Project功能时出现"GC overhead limit exceeded"错误时,这意味着JVM的内存溢出了,在GC(垃圾回收)过程中所花费的时间过长,而回收的堆内存只占很小的比例。这个错误是Hotspot VM 1.6定义的一个策略,旨在提前抛出异常以防止发生OOM(OutOfMemoryError)。 为了解决这个问题,你可以尝试以下几个方法: 1. 增加JVM的内存限制,可以通过在启动Eclipse时添加参数"-XX:MaxPermSize=1024m"来增加最大内存限制。这样在编译文件时将占用更多的内存。 2. 检查你的项目的依赖和资源使用情况,确保没有过多的资源占用内存。 3. 尝试升级Eclipse版本或使用最新的更新来修复可能存在的bug或问题。 4. 如果以上方法都不起作用,你可能需要考虑增加你的计算机的物理内存来提供更大的内存供应。 希望这些方法能够帮助你解决"GC overhead limit exceeded"错误。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* *3* [Eclipse:An internal error occurred during: "Build Project"... GC overhead limit exceeded](https://blog.csdn.net/weixin_34321753/article/details/90149104)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 100%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值