title: PermGen space issue with Glassfish/Hibernate
body: <p>I'm running a GWT+Hibernate app on Glassfish 3.1. After a few hours, I run out of Permgen space. This is without any webapp reloads. I'm running with <code>–XX:MaxPermSize=256m –XmX1024m</code>.</p>
  
  <p>I took the advice from <a href="http://www.samaxes.com/2007/10/classloader-leaks-and-permgen-space/" rel="noreferrer">this page</a>, and found that I'm leaking tons of classes- all of my Hibernate models and all of my GWT RequestFactory proxies.</p>
  
  <p>The guide referenced above says to "inspect the chains, locate the accidental reference, and fix the code". Easier said than done. </p>
  
  <p>The classloader always points back to an instance of <code>org.glassfish.web.loader.WebappClassLoader</code>. Digging further, I find lots of references from <code>$Proxy135</code> and similar-named objects. But I don't know how else to follow through. </p>