Java 中的分配失败

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23858623/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-14 01:35:58  来源:igfitidea点击:

Allocation failure in Java

javamemory-management

提问by dumper

I have a method which hits DB and fetches lot of records into memory for processing. After I fetch the records and before I start processing, I get the following log message. What does it mean ?

我有一种方法可以访问数据库并将大量记录提取到内存中进行处理。在获取记录之后和开始处理之前,我收到以下日志消息。这是什么意思 ?

164575.034: [GC (Allocation Failure)  4937664K->3619624K(5602816K), 0.0338580 secs]

Options:

选项:

java.opts=-d64 -Xmx8g -XX:+PrintGCTimeStamps -verbose:gc -XX:MaxPermSize=512m -XX:+UseParallelGC -XX:+UseParallelOldGC

回答by dumper

It just basically tells you that it had to run GC to allocate additional memory, it does not fit in memory otherwise. So it is just a reason for GC.

它只是告诉你它必须运行 GC 来分配额外的内存,否则它不适合内存。所以这只是GC的一个原因。