Skip to main content

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

Andrew,

How are you running jetty? In a standalone distro, as the maven
plugin, or via embedded code? I take it that the webapp is being
unpacked to a tmp directory?

It does sound as if the WebAppClassloader is being pinned. There
should be a way with the heap dump tool to follow back to the objects
that  are keeping  references to the WebAppClassLoaders, or follow the
link from the doc page to the blog entry about classloader pinning,
which describes how to use JVisualVM to hunt down the references.

Jan



On 1 May 2014 01:11, Andrew Eidsness <eclipse@xxxxxxxxxx> wrote:
> 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
> (http://www.eclipse.org/jetty/documentation/current/preventing-memory-leaks.html)
> by putting this into my jetty.xml file:
>
> <Call name="addBean">
>     <Arg>
>         <New
> class="org.eclipse.jetty.util.preventers.AppContextLeakPreventer"/>
>     </Arg>
> </Call>
>
> But it didn’t seem to make a difference.
>
> Any ideas or pointers to appropriate documentation?
>
> Thanks,
> -Andrew
>
>
> _______________________________________________
> jetty-users mailing list
> jetty-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/jetty-users
>



-- 
Jan Bartel <janb@xxxxxxxxxxx>
www.webtide.com
'Expert Jetty/CometD developer,production,operations advice'


Back to the top