when terracotta is running DGC,it is spent long time(over 5 second) in pause stage.Because application is real-time system,consumer is badly influenced.
How to reduce time spent in running DGC of terracotta.
DGC pause time may be this much because DGC and JAVA GC starts simultaneously.
DGC first concurrently mark the objects and then pause the cluster so that app can not change objects reference. It seems that when DGC pause the cluster , in the mean time JAVA GC also pause the JVM .It makes the pause time so long.I can see in the screenshot, that normally DGC is taking very less time (few milliseconds).
However you can decrease the DGC run time interval from Tc-config.xml.By default DGC run time is 3600 seconds.
Another thing to note is that we are greatly improving DGC times for distributed ehcache in the next release with the new inline DGC feature. With this feature, you dont have to run DGC often and garbage is collected as and when an object is garbage. So the system doesnt have to pause at all during normal operations.
It will be in 3.6 that is scheduled to release end September, beta 2 will be out anytime next week. Give it a try and let us know how it works for you.