You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Jean-Baptiste Quenot (JIRA)" <ji...@apache.org> on 2007/03/31 15:30:26 UTC

[jira] Commented: (WICKET-438) File handles are leaked when loading images from a jar file, Tomcat crashes

    [ https://issues.apache.org/jira/browse/WICKET-438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12485724 ] 

Jean-Baptiste Quenot commented on WICKET-438:
---------------------------------------------

Did you ensure to deploy your application in *deployment* mode?  Did you have a look at the mailing-list archives?  This problem has been reported numerous times, and it's a bug in the JVM.  But a workaround exists in Wicket.

> File handles are leaked when loading images from a jar file, Tomcat crashes
> ---------------------------------------------------------------------------
>
>                 Key: WICKET-438
>                 URL: https://issues.apache.org/jira/browse/WICKET-438
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.2.5
>         Environment: java version "1.5.0_07", Mac OS X 10.4, Tomcat 5.5.20
> and also 
> java version "1.5.0_07", Linux 2.6.8, Tomcat 5.5.17
> Firefox 2.0.3 with Web developer Toolbar
>            Reporter: Stefan Wille
>
> Wicket leaks file handles when it accesses image files that are part of a jar file, e.g. wicket-1.2.5.jar.
> To reproduce this bug, please switch off the browser cache.
> My Wicket application uses TreeTable. When I access the page with the TreeTable on my Mac server, I see the number of open file handles jump. If I do that repeatedly, I can leak about 50 file handles.
> I observe the number of open file handles via this shell command: while true;  do sleep 1; lsof | grep wicket | wc -l; done
> If I do the same test on a Linux server, the number of open files jumps so quickly that I reach 1015 open files after about 4 requests.  At this point, Tomcat runs out of file handles, writes a log entry in catalina.out and dies. Probably Tomcat shouldn't crash, but the problem is that Wicket leaks file handles.
> I can also see leaked file handles when I repeatedly access an image from a jar file via http://localhost:8070/wicket-examples/ajax/resources/wicket.extensions.markup.html.tree.DefaultAbstractTree/res/tree-images.png
> The problem can also be reproduced via wicket-examples 1.2.5 and its TreeTable example page by exanding and collapsing the tree table repeatedly.
> If I unpack both wicket-1.2.5.jar and wicket-extensions-1.2.5.jar in WEB-INF/classes and delete the jars afterwards, the number of used file handles remains constant at 5! So access to images in WEB-INF/classes works fine.
> "lsof | grep wicket" gives me:
> firefox-b 1372 stefan   19r     REG      14,2    486664  1733273 /Users/stefan/Software/apache-tomcat-5.5.20/webapps/middletier/WEB-INF/lib/wicket-extensions-1.2.5.jar
> bash      1880 stefan  cwd      DIR      14,2       578  1058285 /Users/stefan/Software/wicket-1.2.5
> bash      4339 stefan  cwd      DIR      14,2       578  1058285 /Users/stefan/Software/wicket-1.2.5
> java      9529 stefan  txt      REG      14,2   1249210  1750285 /Users/stefan/Software/apache-tomcat-5.5.20/webapps/middletier/WEB-INF/lib/wicket-1.2.zoomos-SNAPSHOT.jar
> java      9529 stefan  txt      REG      14,2    486664  1750274 /Users/stefan/Software/apache-tomcat-5.5.20/webapps/middletier/WEB-INF/lib/wicket-extensions-1.2.5.jar
> java      9529 stefan  txt      REG      14,2     11063  1750305 /Users/stefan/Software/apache-tomcat-5.5.20/webapps/middletier/WEB-INF/lib/wicket-spring-annot-1.2.5.jar
> java      9529 stefan  txt      REG      14,2     24890  1750306 /Users/stefan/Software/apache-tomcat-5.5.20/webapps/middletier/WEB-INF/lib/wicket-spring-1.2.5.jar
> java      9529 stefan   29r     REG      14,2    486664  1750274 /Users/stefan/Software/apache-tomcat-5.5.20/webapps/middletier/WEB-INF/lib/wicket-extensions-1.2.5.jar
> java      9529 stefan   30r     REG      14,2    486664  1750274 /Users/stefan/Software/apache-tomcat-5.5.20/webapps/middletier/WEB-INF/lib/wicket-extensions-1.2.5.jar
> java      9529 stefan   31r     REG      14,2    486664  1750274 /Users/stefan/Software/apache-tomcat-5.5.20/webapps/middletier/WEB-INF/lib/wicket-extensions-1.2.5.jar
> java      9529 stefan   32r     REG      14,2    486664  1750274 /Users/stefan/Software/apache-tomcat-5.5.20/webapps/middletier/WEB-INF/lib/wicket-extensions-1.2.5.jar
> java      9529 stefan   33r     REG      14,2    486664  1750274 /Users/stefan/Software/apache-tomcat-5.5.20/webapps/middletier/WEB-INF/lib/wicket-extensions-1.2.5.jar
> java      9529 stefan   34r     REG      14,2    486664  1750274 /Users/stefan/Software/apache-tomcat-5.5.20/webapps/middletier/WEB-INF/lib/wicket-extensions-1.2.5.jar
> java      9529 stefan   35r     REG      14,2    486664  1750274 /Users/stefan/Software/apache-tomcat-5.5.20/webapps/middletier/WEB-INF/lib/wicket-extensions-1.2.5.jar
> java      9529 stefan   36r     REG      14,2    486664  1750274 /Users/stefan/Software/apache-tomcat-5.5.20/webapps/middletier/WEB-INF/lib/wicket-extensions-1.2.5.jar
> java      9529 stefan   37r     REG      14,2    486664  1750274 /Users/stefan/Software/apache-tomcat-5.5.20/webapps/middletier/WEB-INF/lib/wicket-extensions-1.2.5.jar
> java      9529 stefan   38r     REG      14,2    486664  1750274 /Users/stefan/Software/apache-tomcat-5.5.20/webapps/middletier/WEB-INF/lib/wicket-extensions-1.2.5.jar
> java      9529 stefan   39r     REG      14,2    486664  1750274 /Users/stefan/Software/apache-tomcat-5.5.20/webapps/middletier/WEB-INF/lib/wicket-extensions-1.2.5.jar
> java      9529 stefan   40r     REG      14,2    486664  1750274 /Users/stefan/Software/apache-tomcat-5.5.20/webapps/middletier/WEB-INF/lib/wicket-extensions-1.2.5.jar
> java      9529 stefan   41r     REG      14,2    486664  1750274 /Users/stefan/Software/apache-tomcat-5.5.20/webapps/middletier/WEB-INF/lib/wicket-extensions-1.2.5.jar
> [...many lines like this deleted]

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.