GC (Allocation Failure) [PSYoungGen]

12,125

I think it is the case that the NewSize you might be setting is controlling the size of the entire new generation (which is composed of eden and survivor spaces) so perhaps your eden is still not sufficiently sized to allocate directly into for new large objects (perhaps large byte[]'s for example).

What I am questioning is that even if you set the new to 5Gb, I think Oracle's docs suggest with SurvivorRatio default being 8 would mean approx 1.25Gb of survivor space, leaving 3.75 Gb eden. Is it possible you allocate objects above or close to this size?

With regards to the no such logs, in the answer you link to in your OP the accepted answer makes the comment

"Older JVM were not printing GC cause for minor GC cycles.

So perhaps this was always happening and you just didn't know until now.

Share:
12,125
Bhaskar
Author by

Bhaskar

I am a startup enthusiast and developer. I am currently a founder of company named Worvy and we are trying to solve couple of use cases with help of IoT. Previously I as part of founding team of a company we started named BigMek. I am having 9 years of experience in software development and design/architecture.

Updated on June 04, 2022

Comments

  • Bhaskar
    Bhaskar almost 2 years

    Recently we switched our code to java8 from java7. We are getting GC allocation failure in every 10 minuts for PSYoungGen. We even tried having switch -XX:NewSize and -XX:NewMaxSize in place to around 5GB(total heap size is 10GB). But even after gc allocation failure is getting printed and PSYoungGen is triggering to the almost the size(5GB). Added some logs :

    [GC (Allocation Failure) [PSYoungGen: 3145728K->114922K(3670016K)] 3145728K->115026K(5767168K), 0.2511084 secs] [Times: user=0.26 sys=0.14, real=0.25 secs]
    [GC (Allocation Failure) [PSYoungGen: 4443141K->125893K(4718592K)] 4443261K->126229K(6815744K), 0.2318927 secs] [Times: user=0.42 sys=0.22, real=0.24 secs]
    

    In one of answers: Java GC (Allocation Failure) related to this I have seen this is normal behavior, just curious to know is there any way to overcome this ? Thanks.