On 2013-06-28 Christopher Schultz wrote:
> On 6/27/13 5:17 PM, honyk wrote:
> > On 2013-06-27 Christopher Schultz wrote:
> >> On 6/27/13 4:31 PM, honyk wrote:
> >>> I am constantly encountering PermGen errors despite quite high
> >>> PermGen limit (even 512m) and many options set - approx once a
> >>> week under not heavy load.
> >>
> >> Like what kinds of options? What kind of load? What does the
> >> error look like? Are you re-deploying your webapp without
> >> restarting Tomcat, or do you bust PermGen even with a single
> >> deployment?
> >
> > Tomcat runs as service using these Java opts (tomcat7w.exe) -
> > single line
> >
> > -Duser.language=en -XX:MaxPermSize=512m -XX:+DisableExplicitGC
> > -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled
> >
> > Originally I used Apache JkMount/Worker to hide that port number.
> > In that case there were listed these errors in the tomcat err log:
> > Exception in thread "ajp-bio-8009-exec-7"
> > java.lang.OutOfMemoryError: PermGen space
> 
> I recommend that you run with -XX:+HeapDumpOnOutOfMemoryError and
> possibly also with -XX:HeapDumpPath=[path to where you want your heap
> dumps to go].

All my options were specified on a single line and thus ignored.
This is the reason why I was getting PermGen errors constantly even when high 
values were specified...

My default value is approx. 85 MB and when all my web apps are invoked, cca 90 
MB is needed. 

Currently I use these settings (JDK 7):
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Duser.language=en
-XX:+DisableExplicitGC
-XX:MaxPermSize=128m
-XX:+HeapDumpOnOutOfMemoryError
-XX:HeapDumpPath=C:/DataStorage/tomcat-heap-dump
-XX:OnOutOfMemoryError=""C:\trunk\Tools\Macros\TomcatKiller\task.bat %p""

I removed following options as they seem to be obsolete (?) in JDK 7:
-XX:+CMSClassUnloadingEnabled 
-XX:+CMSPermGenSweepingEnabled

Now my tomcat instance works fine. When OOME occurs (I hope it will never 
happen :), dump is created and my script executed (taskkill /F /PID %1 + 
sending e-mail to me). The tomcat windows service is set to restart itself one 
minute after the first failure (which is triggered when process is killed). My 
apps are simple tools and reports, nothing critical, so I hope this autokilling 
doesn't harm.

I still cannot profile the JVM locally, but this is not an issue any more. For 
basic tomcat monitoring the JMX capabilities are sufficent. But my thread in 
VisualVM forum is still opened and in case of any update I'll let you know.

Thanks you guys for your hints, I learned a lot from your responses recently!

Regards, Jan


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to