Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] java.lang.OutOfMemoryError: PermGen space

My jetty server (9.1.4.v20140401) eventually runs out of memory after I’ve deployed the same war (during development) to the webapps folder. After looking in the bugs database I think this might be happening because I’m deploying jars inside the war’s lib folder.

The reason I think this is that looking at the heap dump (in MAT) I can see 8 copies of classes from those bundled jars. Each of the instances was loaded by a different instance of org.eclipse.jetty.webapp.WebAppClassLoader.

My theory is that when the war is redeployed a new instance of WebAppClassLoader is created which then loads the new jar files.

I think I’m doing something wrong, but haven’t been able to figure out what. I’m not sure how to get the old class loader’s to go away.

I’ve tried using the leak preventer ( by putting this into my jetty.xml file:

<Call name="addBean">
        <New class="org.eclipse.jetty.util.preventers.AppContextLeakPreventer"/>

But it didn’t seem to make a difference.

Any ideas or pointers to appropriate documentation?


Back to the top