Support Article
java.lang.OutOfMemoryError: PermGen space
SA-7882
Summary
Administrator has observed OutOfMemory errors in the logs and experiencing PRPC getting hung. They want to know the root cause for this issue. They are using Pega 7.1.6 on JBOSS and Linux. Max Perm size was set to be 384MB and they have few questions:-
1. How much should we increase the Max PermGen and how can we determine it, based on what.
2. I want to make sure this PermGen is not because of high system pressure (requestors, clipboard size, agent) but it is size of development.
Error Messages
java.lang.OutOfMemoryError: PermGen space
Steps to Reproduce
N/A
Root Cause
Observed lot of PEGA00028 alerts in the log file:
2015-03-18 04:06:19,578 GMT*7*PEGA0028*402651072*362387865*7f99aa07dd237344ad3ede7d456ee806*NA*NA*NA*NA*NA*NA*NA*?*-1*2012*Service Thread*NA*com.pega.pegarules.management.internal.events.JVMNotificationManager*NA*NA*NA*NA*NA*NA*NA*NA*NA*NA*NA*NA*Collection usage threshold exceeded for class storage memory pool (PS Perm Gen) INFO:MemoryPool=PS Perm Gen;PoolType=class storage;Event=java.management.memory.collection.threshold.exceeded;TimeStamp=2015-03-18 04:06:19,578
The PermGen space has been exceeded.
Resolution
The MaxPermSize value of 512m is recommended as a guideline, and some customers find that they need to increase it past that value. In this case, if 512m is getting exceeded - this is an expected behaviour for PRPC applications that have a large number of rules and rulesets (since each unique ruleset list has its own version of assembled classes).
You can also consider using below configuration parameter to your start-up scripts(both is required to be set so that it allows GC to unload classes):
-XX:+CMSClassUnloadingEnabled
-XX:+UseConcMarkSweepGC
You can verify the PermGen space using VisualVM.
Refer following VisualVM screen –

Published January 31, 2016 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.