From: Chris H. <ch...@ha...> - 2007-01-26 16:29:46
|
I'm not defending all of Jetty's existing behaviour, but IMHO is is entirely right and proper to call programatically for garbage collection at a time which suits the application. In a service of my own design, in which everyone has to have a session, I call gc() when the last user ends her session, so as to reduce the probability that a gc() (with resulting response delay) will happen with someone logged in. Chris Haynes On Friday, January 26, 2007 at 2:38:10 PM, Christoph Kutzinski wrote: > Jan, > Yes, I suspected that already though I even can't see any benefit in that case. > Nearly every advice about GC, I read, mentioned that "you should > never explicitely call System.gc()" and instead let the garbage > collector itself determine when it is right to make a full GC. > So IMHO, this behavior should be made configurable at least. > greetings > Christoph > jet...@li... wrote: >> Christoph, >> Don't forget that destroy() is not only called from shutdown, it >> can also be called to remove a webapp from a server which >> continues to run (eg hot undeploy/redeploy scenario). >> I suppose some optimization might be possible to avoid calling >> the garbage collector if indeed the whole server is shutting down. >> Lemme look into it. >> cheers >> Jan >> Christoph Kutzinski wrote: >>> Does no one have an answer for this? >>> I just wanted to know the reasoning why Jetty calls System.gc() at >>> that point. I doesn't make any sense to me, but maybe someone elese >>> can see a sense in it. >>> Christoph >>> jet...@li... wrote: >>>> Hi, >>>> we noticed that the shutdown of our application running on >>>> top of jetty takes ununsually long. >>>> We found out that 5 full garbage collections are run during >>>> jettys shutdown, which seems to be the main cause for this. >>>> Upon further investigation I found out that Jetty explicitly >>>> calls System.gc() in ResourceCache.flushCache() which is in >>>> turn called from HttpContext.destroy(). >>>> So apparently for each webapp Jetty calls System.gc() once during >>>> shutdown. >>>> Is this really necessary? We would at least like to have a >>>> property which makes this behaviour configurable. >>>> thanks, >>>> Christoph >>>> -------------------------------------------------------------- >>>> ----------- >>>> Take Surveys. Earn Cash. Influence the Future of IT >>>> Join SourceForge.net's Techsay panel and you'll get the chance to >>>> share your opinions on IT & business topics through brief surveys - >>>> and earn cash >>>> http://www.techsay.com/default.php?page=join.php&p=sourceforge >>>> &CID=DEVDEV _______________________________________________ >>>> jetty-discuss mailing list jet...@li... >>>> https://lists.sourceforge.net/lists/listinfo/jetty-discuss >> -------------------------------------------------------------- >> ----------- >>> Take Surveys. Earn Cash. Influence the Future of IT >>> Join SourceForge.net's Techsay panel and you'll get the chance to >>> share your opinions on IT & business topics through brief surveys - >>> and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your opinions on IT & business topics through brief surveys - and earn > cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > jetty-discuss mailing list > jet...@li... > https://lists.sourceforge.net/lists/listinfo/jetty-discuss > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > jetty-discuss mailing list > jet...@li... > https://lists.sourceforge.net/lists/listinfo/jetty-discuss |