The Dreaded PermGen Error

Christopher Bongaarts cab at umn.edu
Mon Nov 11 13:29:17 EST 2013


On 11/11/2013 10:23 AM, Joshua Riffle wrote:
> 1) How do you detect or prevent the evil PermGen error beforehand? My 
> understanding is increasing the MaxPermGenSize is only delaying the 
> inevitable memory leak build up.

Look at your permgen usage as you're running (attach a jvisualvm or 
whatever JVM state inspection tools you have handy).  I've haven't 
noticed any leakiness on ours - they settle in at a large but stable value.

> 2) Better yet: Best practices? What have you already done in your 
> architecture to avoid or defeat this kind of issue?

We increase our permgen size from the default (64MB?) to 128MB or so; 
the actual stable usage was about 50MB or so, so it might not actually 
be necessary these days (since we ditched terracotta).

We also remove the optimizer from rhino (was necessary for terracotta, 
doesn't hurt anything now, and since it prevents creation of a bunch of 
anonymous classes, might help keep a tidier permgen space).

Never restart the IdP app or context by itself - always do a full 
restart of Tomcat.  (I think I heard that this will no longer be 
required in IdP 3.)

-- 
%%  Christopher A. Bongaarts   %%  cab at umn.edu          %%
%%  OIT - Identity Management  %%  http://umn.edu/~cab  %%
%%  University of Minnesota    %%  +1 (612) 625-1809    %%



More information about the users mailing list