Why so insignificant GC

These are my JVM options:

> /usr/local/java/bin/java -Xloggc:log/gc.log -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=70 -XX:PermSize=64m -XX:MaxPermSize=64m -Xss128K -server -Xmn1024m -Xms3027m -Xmx3027m -Dresin.home=/usr/local/resin 

I use Resin, up - these are the JVM parameters for starting Resin, my next GC output when I use jstat -gcutil pid 1000 1000

  S0 S1 EOP YGC YGCT FGC FGCT GCT 0.00 1.60 46.21 25.62 21.69 72639 941.082 31 0.275 941.357 1.51 0.00 51.91 25.63 21.69 72640 941.093 31 0.275 941.368 0.00 1.87 62.96 25.64 21.69 72641 941.104 31 0.275 941.379 1.51 0.00 86.39 25.65 21.69 72642 941.114 31 0.275 941.389 0.00 1.56 94.28 25.65 21.69 72643 941.126 31 0.275 941.401 0.00 1.45 5.03 25.67 21.69 72645 941.146 31 0.275 941.421 1.74 0.00 18.76 25.68 21.69 72646 941.158 31 0.275 941.433 0.00 1.85 37.51 25.69 21.69 72647 941.169 31 0.275 941.443 1.59 0.00 53.58 25.70 21.69 72648 941.180 31 0.275 941.455 0.00 1.74 74.02 25.71 21.69 72649 941.192 31 0.275 941.467 

We can find the younger GC about once per second, I feel like it is very common, because my new size is Edanz 1g.so why is it so common or is that a normal thing?

+4
source share
1 answer

Either you are not 1 GB Eden, or you create incredible garbage information. Since you do not seem to set your Eden size, you suspect it is much smaller than you think.

Try using jstat -gccause instead to see the dimensions.

I suspect you have read http://www.caucho.com/resin-3.0/performance/jvm-tuning.xtp , which incorrectly claims that -Xmn sets up the Eden space .;)

The -Xmx parameter sets the maximum total heap size (young and old)

The -Xmn parameter sets the size of the young generation, consisting of the space of Eden and the two survivors. Since your surviving spaces do not seem very full, I suspect that they make up most of the 1 G of the younger generation.

http://www.oracle.com/technetwork/java/javase/tech/exactoptions-jsp-141536.html

Try setting -XX:SurvivorRatio= to something like 10, and most of the 1 GB will be Eden space.

http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html

+4
source

Source: https://habr.com/ru/post/1432429/


All Articles