OutOfMemoryError with WebWork

I've been working along at a fast enough clip now with WebWork that I've touched off a long-standing class memory leak in something. JBoss tells me I'm out of PermGen space after I repeatedly redeploy my WebWork application. From online discussions, it seems to be well-known to exist somewhere between CGLIB, Spring, Hibernate, and Tomcat, but everyone blames everyone else.

I wish I knew which component was causing it and knew how to eliminate that component. I doubt it's Hibernate in my case, because I'm only using Hibernate indirectly through the EJB3 persistence layer, and I'm not actually redeploying the EJB side of the app when this happens. If I understand correctly, WebWork's using Spring, which uses CGLIB. WebWork apparently used to use another object factory instead of Spring, but I'm not sure what it was or how to get back to that. There's a nice webwork.objectFactory property, but I've found no evidence of it being setable to anything but spring.

Until I figure it out, I guess I'll be restarting my development instance of JBoss periodically, and I'll just have to be careful about hot deploying to my production box when that day comes. Fortunately, none of my current projects have had the benefit of reaching production quality recently.


Filed Under: Computers Web-Dev Java