如何解决'java.lang.OutOfMemoryError:超出GC开销限制' [英] how to solve 'java.lang.OutOfMemoryError: GC overhead limit exceeded'

查看:153
本文介绍了如何解决'java.lang.OutOfMemoryError:超出GC开销限制'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看了这个堆栈溢出有关解决此问题的页面并尝试添加命令行选项-XX:-UseGCOverheadLimit以及-Xmx参数。但是,我的程序仍然会抛出内存不足错误。

I read this stack overflow page about solving this problem and tried adding the command line option -XX:-UseGCOverheadLimit and also "-Xmx" arguments. However, my program still threw the out of memory error.

程序将大量(> 40,000个键)的单词保存到MultiKeyMap中,并在服务器上运行充足的记忆。

The program saves a large number (>40,000 keys) of words into a MultiKeyMap and is running on a server with plenty of memory.

关于如何避免错误的任何建议?

Any suggestions on how I can aviod the error?

推荐答案

如果您的问题可靠地减少(说实话,即使不是),我建议激活 -XX:+ HeapDumpOnOutOfMemoryError JVM标志。当存在 OutOfMemoryError 时,会产生内存的二进制转储。然后可以通过 Eclipse MAT 等工具对此进行分析,以识别潜在的内存泄漏并帮助解释原因垃圾收集器很难清除你的对象。

If your problem is reliably reduced (to be honest, even if it's not) I suggest activating the -XX:+HeapDumpOnOutOfMemoryError JVM flag. This will, when there is an OutOfMemoryError, produce a binary dump of the memory. This can then be analysed by tools such as Eclipse MAT to identify potential memory leaks and help to explain why the Garbage Collector is having such a hard time clearing out your objects.

这篇关于如何解决'java.lang.OutOfMemoryError:超出GC开销限制'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆