permgen memory issues in CAS 4.2.2 under tomcat7

Skip to first unread message

Jeffrey Wong

unread,
Jul 1, 2016, 3:08:17 PM7/1/16
to CAS Community
Hey there!

I'm running a pretty vanilla CAS system as a login system for a few internal applications at my company at a pretty low traffic rate. My CAS deployment fell off this morning (running 4.2.2) due to Permgen out of memory issues. I've got a few questions as to how best to mitigate CAS' downtime.

Suggestions seem to say that CMSClassUnloadingEnabled should be ticked. Does this help to alleviate issues? (Flag is for cleaning up unused classes out of memory. Does CAS dynamically allocate many classes at runtime that I should be worried about, or am I misconfiguring something?)

I also control the environment and wondering if java 8's memory management and GC implementation would help to mitigate this kind of stuff. Is 4.2.2 supported in java 8 or do I have to wait for the v5 to drop? Does java8 help with memory management?

Appreciate any assistance,
-Jeff

Richard Frovarp

unread,
Jul 1, 2016, 3:21:02 PM7/1/16
to Jeffrey Wong, CAS Community
On 07/01/2016 02:08 PM, Jeffrey Wong wrote:
Hey there!

I'm running a pretty vanilla CAS system as a login system for a few internal applications at my company at a pretty low traffic rate. My CAS deployment fell off this morning (running 4.2.2) due to Permgen out of memory issues. I've got a few questions as to how best to mitigate CAS' downtime.

Suggestions seem to say that CMSClassUnloadingEnabled should be ticked. Does this help to alleviate issues? (Flag is for cleaning up unused classes out of memory. Does CAS dynamically allocate many classes at runtime that I should be worried about, or am I misconfiguring something?)


I don't know about CAS specifically, but I doubt this will help much. If the classes were loaded, they're probably needed. While it might clean things up in the short term, they will most likely just get loaded again at some point in the future.


I also control the environment and wondering if java 8's memory management and GC implementation would help to mitigate this kind of stuff. Is 4.2.2 supported in java 8 or do I have to wait for the v5 to drop? Does java8 help with memory management?


With Java 8 you'll never have another permgen issue. That memory pool has been removed. Documentation states Java 1.7+, so I would expect 8 to work.

In the short term, just throw more memory at permgen. It's one of the command line flags for when your container starts up. I think by default it is pretty low. Be sure to set -XX:PermSize and -XX:MaxPermSize to the same value. If you're running default, it's probably under 100m, I would go to 512m, unless that's what you already have.

It is possible that if it is doing a lot of application redeploys in the same container that there is a leaking class loader that will cause it to eventually fill it up.

Christopher Myers

unread,
Jul 1, 2016, 3:21:26 PM7/1/16
to cas-...@apereo.org
Not sure if this will help, but here's some notes I took when I was configuring our memory management stuff; we're using Java 7 still.

Our Tomcat setenv.sh looks like:

CATALINA_OPTS="-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"

(We run more than CAS on the TC instance though, it sounds like you won't need anything this big.)

Chris

>>> Jeffrey Wong <awo...@gmail.com> 07/01/16 2:08 PM >>>
--
You received this message because you are subscribed to the Google Groups "CAS Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+u...@apereo.org.
To post to this group, send email to cas-...@apereo.org.
Visit this group at https://groups.google.com/a/apereo.org/group/cas-user/.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/8e789406-054c-4641-b7be-dae197732454%40apereo.org.
For more options, visit https://groups.google.com/a/apereo.org/d/optout.
noreply@millikin.edu_20160701_143826.pdf

Jeffrey Wong

unread,
Jul 1, 2016, 3:35:21 PM7/1/16
to CAS Community, cmy...@mail.millikin.edu
Thanks so much for the quick responses, it's greatly appreciated! I'll try those options, and look into a java update soon.
Reply all
Reply to author
Forward
0 new messages