1

We have a application Running on java 1.8 with high heap utilization on production servers and found that Major GC is not happening at all. Same configurations have been applied to a non prod machine, but Major GC runs every one hour there. What triggers Major GC, does better H/W (More CPU's) on prod is causing any issues ?

java.args=-server -Xms3072m -Xmx3072m -XX:NewSize=1024m -XX:MaxNewSize=1024m -XX:MaxMetaspaceSize=1024m -XX:NewRatio=4 -Dsun.io.useCanonCaches=false -XX:+UseParallelGC -XX:+UseAdaptiveSizePolicy -XX:-CreateMinidumpOnCrash 

Thanks in Advance.

trincot
  • 317,000
  • 35
  • 244
  • 286
user1550159
  • 1,197
  • 3
  • 19
  • 36
  • enable gc logging with `-XX:+PrintGCDetails`, analyze logs, e.g. with gcviewer if you want to know more. without further data it's hard to come to any conclusions. – the8472 Oct 20 '16 at 22:30
  • 1
    If the application has enough free heap memory, Major GC will not be triggered. With JConsole (comes with your JDK) you can check memory usage. – ravthiru Oct 20 '16 at 22:57
  • 2
    Is triggering Major GCs the actual purpose of your application? Or, in other words, *what’s the problem*? – Holger Oct 21 '16 at 11:23
  • @user1550159 Did you find the solution; could you point us to one? Were any of answers helpful, or addressing your question?. Thanks. – Witold Kaczurba Oct 31 '16 at 07:52

2 Answers2

1

Oracle / Java never guarantees that GC would run. That is the biggest issue about Garbage Collection that you cannot predict its behavior

Witold Kaczurba
  • 9,845
  • 3
  • 58
  • 67
  • Thanks, but why would it behave differently between 2 servers when they have same settings ? – user1550159 Oct 20 '16 at 20:06
  • @user1550159 There is a couple of answers on this already on the stackoverflow (like here: http://stackoverflow.com/questions/1582209/java-garbage-collector-when-does-it-collect and here: http://stackoverflow.com/questions/6909150/how-often-is-the-gc-executed . I would expect that two different servers should behave differently as they will vary in terms of hardware and actual software that runs on them; this will affect available memory and new requirements. – Witold Kaczurba Oct 21 '16 at 01:29
0

I can see you are using Parallel collector from the settings you shared, This will trigger a major collection each time your old generation becomes full. Memory consumed is a function of workload so if you have same workload on both environment you should get similar number of major collections for same heap sizes in both environment.

Deven
  • 416
  • 3
  • 7