2

I am using JDK 1.7.45 version in my application. Max heap size is capped to 4 GB. I am using CMS algorithm.

YoungGEN is more in my application compared to oldGen. I am getting application pauses around 10 seconds due to GC activity.

Current VM Opts:

server -d64 -verbose:gc -Xms4g -Xmx4g -XX:NewSize=2g -XX:MaxNewSize=2g 
-XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:CMSInitiatingOccupancyFraction=60 
-XX:TargetSurvivorRatio=90 -XX:+CMSScavengeBeforeRemark 
-XX:+UseCMSInitiatingOccupancyOnly -XX:+CMSClassUnloadingEnabled 
-XX:PermSize=64m -XX:MaxPermSize=256m -XX:ParallelGCThreads=23 
-XX:+DisableExplicitGC -XX:+PrintGCDateStamps -XX:+DoEscapeAnalysis 
-XX:LargePageSizeInBytes=2m  -XX:+PrintTenuringDistribution 
-XX:+PrintGCTimeStamps -XX:+PrintGCDetails 
-XX:+PrintGCApplicationStoppedTime -XX:+HeapDumpOnOutOfMemoryError 
-XX:HeapDumpPath=$PP_HOME -XX:+UseLargePages -XX:+UseCompressedOops 
-XX:+AggressiveOpts"

GCLog:

[Full GC2015-12-02T06:37:14.442-0500: 177139.493: [CMS: 2263908K->308791K(4194304K), 
4.6323730 secs] 2647235K->308791K(6081792K), [CMS Perm : 87315K->87296K(145380K)], 
4.6346330 secs] [Times: user=4.51 sys=0.02, real=4.63 secs]

Total time for which application threads were stopped: 12.0121050 seconds
Ravindra babu
  • 42,401
  • 8
  • 208
  • 194
  • See if this helps. http://stackoverflow.com/questions/9005632/useconcmarksweepgc-vs-useparallelgc – Dalton Russell Jun 16 '15 at 19:07
  • 2
    There is no "best" algorithm. You need to gather all the information you can, profile your application, print out GC info and hopefully you'll be able to see from there what aspect of your application is causing the problem and how to get around it. – biziclop Jun 16 '15 at 19:12
  • 1
    YG pauses of anything more than a second are really weird. You need to profile your app to see what is creating all those objects, and if they are getting tenured. Also, you don't say what platform or architecture. This can be important if, say, the problem here is the heap is being swapped out to disk. –  Jun 16 '15 at 19:28
  • Is your hardware / JVM 32-bit or 64-bit, and which VM are you using (I'm assuming HotSpot)? How many logical cores does it have, and will any other programs besides the OS be using them? What kind of objects are you allocating, e.g. are they mostly strings? Are you more concerned about reducing pause times or with maximizing throughput? – Zim-Zam O'Pootertoot Jun 16 '15 at 19:28
  • It's 64 bit hotspot VM with dual core. No other processes are running in it. These objects are mostly strings. I am concerned about pause time only. – Ravindra babu Jun 17 '15 at 00:53
  • I think you are asking the wrong question. What you should do is ask why your young gen GCs take so long - that is not normal. Run your application with `-XX:+PrintGCDetails` and come back to ask a new question about your young yen pauses with that log. As the question stands now I vote to close it, it is to broad. – K Erlandsson Jun 17 '15 at 06:49
  • Unfortunately I do not have data now as logs have been removed. I have to wait for 2 weeks to get high memory usage. From the graphs of monitoring tool, it is evident that 60% of young gen (around 1.2 GB) memory has taken 10 seconds for Garbage collection with UseParallelGC option. Is any other alternative reduce GC time? – Ravindra babu Jun 18 '15 at 15:26
  • Question is reworded now. – Ravindra babu Dec 10 '15 at 05:46

0 Answers0