Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Stop Jetty and free classloader in perm memory

Hi,

first, thanx Julio, your links were useful.

I can free up the memory by releasing explicitly the LogFactory relative to the WebAppClasLoader (LogFactory.release(WebAppClassLoader)) but only if I launch only one webapp in the JETTY server.
If I launch several webapps (two...) The WebAppClassloader are not released. It seems to be related to xerces.
Is there something in xerces that I need to release explicitly?
Are There other know classes that need to be explicitly released?

Thanks by advance for any hints.

Aurelien Pupier

2009/12/7 Julio Viegas <julioviegas@xxxxxxxxxxxxxxx>
Hello Aurelien,

  Maybe you can follow bellow directions to narrow which class causes the leak:

  http://blogs.sun.com/fkieviet/entry/classloader_leaks_the_dreaded_java
  http://blogs.sun.com/fkieviet/entry/how_to_fix_the_dreaded

  I ran into this kind of problem in the past with tomcat, and all I
can say is that this is one of the most trickier and time consuming
issues. Probably it is caused by user code and not by app server code.

Good luck,
JV -- julioviegas.com

On Mon, Dec 7, 2009 at 11:24, Aurélien Pupier
<aurelien.pupier@xxxxxxxxxxxxxx> wrote:
> Hi,
>
> First, sorry for the previous mail which was send prematurely :s
>
> So,
>
> I'm using Jetty 6.
>
> I started the server this way :
> Server server = new
> Server(store.getDefaultInt(ConsolePreferenceConstants.CONSOLE_PORT));
> WebAppContext warWebappContext = new WebAppContext(MyWebApp, MyContextPath);
> warWebappContext.setClassLoader(new WebAppClassLoader(MyClassloader,
> warWebappContext));
> server.addHandler(warWebappContext);
> And then close it this way :
> consoleServer.stop();
> consoleServer.destroy();
>
> But like that the classloader is kept in perm memory (I use a dump of the
> memory to see that)
> As I stop and start an amount of time the server there is a a lot of
> Clasloader in perm memory which is never released.
>
> I tried several things to free them :
> - remove WebAppContext from server handler.
> - stop and destroy WebAppContext
> - destroy the WebAppClassLoader
>
> and call System.gc() after each of these attempts without success in any
> case.
>
> So what is proper way to shutdown the server and free up the memory from
> classloader?
>
> Thanks by advance for any hints.
> Regards,
>
> Aurelien Pupier
>
> PS : I didn't see a jetty forum on Eclipse forum, no one exist?
> _______________________________________________
> jetty-users mailing list
> jetty-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/jetty-users
>
>
_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jetty-users


Back to the top