One thing we had to do on ours was set the stack size; the default was too big for the number of sessions we cache, so we set it to -Xss512k.
Also, we don't use ehcache, we use hazelcast because it was WAY easier to set up. Also have 2+1+1 nodes (two primary, one backup, and one "server of last resort" on a different set of hardware elsewhere.)
You might also consider setting your Xms and Xmx to be the same value - you'll probably end up at the 4GB limit eventually anyhow, so stating Java out with the max will help prevent memory fragmentation.
To help with tuning ours, I kept JVisualVM running on the boxes, so I could watch what was happening when the servers would run out of memory. Also, you might look into thread dumping and using parsejstack on the dump.
These are our tuning parameters for Java7; they don't work on Java8 because of the massive changes that Oracle made in Java8, but might maybe help out somehow?
-Xms6g
-Xmx6g
-Xss512k
-Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true
-XX:+UseCompressedOops
-XX:MaxPermSize=256m
-XX:NewRatio=3
-XX:SurvivorRatio=8
-XX:+UseConcMarkSweepGC
-XX:+UseParNewGC
-XX:+DisableExplicitGC
-XX:+UseCMSInitiatingOccupancyOnly
-XX:+CMSClassUnloadingEnabled
-XX:+CMSScavengeBeforeRemark
-XX:CMSInitiatingOccupancyFraction=68
>>> Juan Carlos Giménez Moncada<
mon...@um.es> 06/16/16 9:00 AM >>>