You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Fleischer Peter <pe...@munich-airport.de> on 2007/06/20 10:56:42 UTC

[Trinidad] Causing Too many open files error?

Hello,

we are developing a quite simple application based on MyFaces, Trinidad and Facelets. After deploying this application to a Tomcat 5.5.23 and using the application for a while we are facing connection errors in Tomcat caused by too many open files.

Checking the running Tomcat process with lsof (list open files) we discovered, that  <application>/WEB-INF/lib/trinidad-impl-1.0.1-incubating-SNAPSHOT.jar was open for about 300 times. The number rises with every request. At some time eventually a garbage collection closes all these files.

I don't think this is a Tomcat error, because this jar is the only jar file opened so many times. Perhaps some Trinidad code fails to close a file? Is this a known issue?

Many thanks in advance.

Peter Fleischer

_____________________________________________________________

Munich Airport International
Flughafen München GmbH
Peter Fleischer
ITED Competence Center Application Development
Support Division Information Technology 
P. O. Box  23 17 55
85326 München
Phone: +49 89 975-3 24 30
Fax: +49 89 975-3 24 06
<ma...@munich-airport.de>

Vorsitzender des Aufsichtsrats: - Chairman of the Supervisory Board:	
Staatsminister Prof. Dr. Kurt Faltlhauser
Geschäftsführung: - Executive Board:
Dr. Michael Kerkloh, Walter Vill und Peter Trautmann
Handelsregister: - Commercial Register: RG München, HR-Nr. B 5448
Sitz der Gesellschaft: - Registered Office: München
_____________________________________________________________


Re: [Trinidad] Causing Too many open files error?

Posted by Adam Winer <aw...@gmail.com>.
Yep - lately, I've switched from once a month to try to have
1.2 branches in sync with the 1.0 releases - so we'll
have a 1.2.1 release along with the 1.0.1 release and the
two line up.  If we follow that line, then the fix would
go into 1.2 around the same time as we're getting ready
to release 1.0.2.

-- Adam


On 6/22/07, Matthias Wessendorf <ma...@apache.org> wrote:
> Yes,
>
> the 1.2-branch is created once in a while (currently once per month)
> based on the trunk (all fixes go in here) + a bit of Adam's magic to
> get JSF 1.2 in.
>
> -M
>
> On 6/22/07, mike.sauer@convergys.com <mi...@convergys.com> wrote:
> >
> > Will this fix also have been applied to the 1.2 branch?
> >
> >
> >
> > "Adam Winer" <aw...@gmail.com> wrote on 06/21/2007 05:28:32 PM:
> >
> >
> >  > On 6/21/07, Simon Lessard <si...@gmail.com> wrote:
> >
> > > Hmmm, I assume this is used mainly to detect skin files' version?
> > >
> >  >
> > > It's used in a bunch of places to detect modification - skin
> > > files, ResourceServlet, jsp modifications, etc.
> > > I've checked in a fix that should resolve this,
> > > but I'm not 100% sure.  I've mostly been looking at
> > > the calls to FileInputStream.finalize() - there were a
> > > lot coming in that had still-open FileDescriptors.
> > > I'd appreciate further testing.
> > >
> >  > It'd be worthwhile to look at optimizing further to block
> > > any attempt to call getLastModified() on a JAR, but
> > > for now I'm hoping it'll be enough to close up all URLConnections.
> > > In a bit of googling, it'd seem that this has bitten a lot
> > > of developers.
> > >
> >  > -- Adam
> > >
> >  > Maybe we could create a kind of ResourceDescriptor file that would
> >  > include two URLs, the real one and the container file's (the .jar
> >  > URL for instance, but would be the same as the real URL most of the
> >  > time). The getLastModified method of the ResourceDescriptor could
> >  > then use that second URL for purpose of modification checks,
> >  > theorically preventing the JVM from opening the JAR file.
> >  >
> >  >
> >  > Regards,
> >  >
> >  > ~ Simon
> > >
> >
> > > On 6/21/07, Adam Winer < awiner@gmail.com> wrote:
> > > I think I've found the problem - Trinidad calls
> > > URLConnection.getLastModified() in a number
> > > of places.  If that's pointing at an URL from
> > > inside a JAR, this will implicitly open the
> > > JAR file, and not release the file until GC.
> > > Looking at solutions now.
> > >
> >  >
> > > -- Adam
> > >
> >
> > > On 6/21/07, Fleischer Peter
> > <pe...@munich-airport.de> wrote:
> > > The problem is reproducable. After restarting tomcat and some
> >  > requests to my application the jar file will again be opened
> >  > multiple times. Every (initial?) request to a page increases the
> >  > number. Eventually after some time the files are garbage collected.
> > >
> > > Peter
> > > -----Ursprüngliche Nachricht-----
> >  > Von: Scott O'Bryan [mailto:darkarena@gmail.com]
> >  > Gesendet: Donnerstag, 21. Juni 2007 00:29
> >  > An: MyFaces Discussion
> >  > Betreff: Re: [Trinidad] Causing Too many open files error?
> >
> > > I saw this as well using Oracle JDeveloper so I agree that I don't
> >  > think this is a Tomcat issue.  I'm not sure what might be causing
> >  > this though because I shut down my webserver and restarted it and
> >  > everything has been working fine since.
> >  >
> >  > What happens when you restart tomcat?
> >  >
> >  > Scott
> >
> > > On 6/20/07, Fleischer Peter
> > <peter.fleischer@munich-airport.de > wrote:
> > > Hello,
> >  >
> >  > we are developing a quite simple application based on MyFaces,
> >  > Trinidad and Facelets. After deploying this application to a Tomcat
> >  > 5.5.23 and using the application for a while we are facing
> >  > connection errors in Tomcat caused by too many open files.
> >  >
> >  > Checking the running Tomcat process with lsof (list open files) we
> >  > discovered, that  <application>/WEB-INF/lib/trinidad-
> > impl-1.0.1-
> >  > incubating-SNAPSHOT.jar was open for about 300 times. The number
> >  > rises with every request. At some time eventually a garbage
> >  > collection closes all these files.
> >  >
> >  > I don't think this is a Tomcat error, because this jar is the only
> >  > jar file opened so many times. Perhaps some Trinidad code fails to
> >  > close a file? Is this a known issue?
> >  >
> >  > Many thanks in advance.
> >  >
> >  > Peter Fleischer
> >  >
> >  >
> > _____________________________________________________________
> >  >
> >  > Munich Airport International
> >  > Flughafen München GmbH
> >  > Peter Fleischer
> >  > ITED Competence Center Application Development
> >  > Support Division Information Technology
> >  > P. O. Box  23 17 55
> >  > 85326 München
> >  > Phone: +49 89 975-3 24 30
> >  > Fax: +49 89 975-3 24 06
> >  > <mailto:peter.fleischer@munich-airport .de >
> >  >
> >  > Vorsitzender des Aufsichtsrats: - Chairman of the Supervisory Board:
> >  > Staatsminister Prof. Dr. Kurt Faltlhauser
> >  > Geschäftsführung: - Executive Board:
> >  > Dr. Michael Kerkloh, Walter Vill und Peter Trautmann
> >  > Handelsregister: - Commercial Register: RG München, HR-Nr. B 5448
> >  > Sitz der Gesellschaft: - Registered Office: München
> >  >
> > _____________________________________________________________
> >
> > >
> >  >
> >  >
>
>
> --
> Matthias Wessendorf
>
> further stuff:
> blog: http://matthiaswessendorf.wordpress.com/
> mail: matzew-at-apache-dot-org
>

Re: [Trinidad] Causing Too many open files error?

Posted by Matthias Wessendorf <ma...@apache.org>.
Yes,

the 1.2-branch is created once in a while (currently once per month)
based on the trunk (all fixes go in here) + a bit of Adam's magic to
get JSF 1.2 in.

-M

On 6/22/07, mike.sauer@convergys.com <mi...@convergys.com> wrote:
>
> Will this fix also have been applied to the 1.2 branch?
>
>
>
> "Adam Winer" <aw...@gmail.com> wrote on 06/21/2007 05:28:32 PM:
>
>
>  > On 6/21/07, Simon Lessard <si...@gmail.com> wrote:
>
> > Hmmm, I assume this is used mainly to detect skin files' version?
> >
>  >
> > It's used in a bunch of places to detect modification - skin
> > files, ResourceServlet, jsp modifications, etc.
> > I've checked in a fix that should resolve this,
> > but I'm not 100% sure.  I've mostly been looking at
> > the calls to FileInputStream.finalize() - there were a
> > lot coming in that had still-open FileDescriptors.
> > I'd appreciate further testing.
> >
>  > It'd be worthwhile to look at optimizing further to block
> > any attempt to call getLastModified() on a JAR, but
> > for now I'm hoping it'll be enough to close up all URLConnections.
> > In a bit of googling, it'd seem that this has bitten a lot
> > of developers.
> >
>  > -- Adam
> >
>  > Maybe we could create a kind of ResourceDescriptor file that would
>  > include two URLs, the real one and the container file's (the .jar
>  > URL for instance, but would be the same as the real URL most of the
>  > time). The getLastModified method of the ResourceDescriptor could
>  > then use that second URL for purpose of modification checks,
>  > theorically preventing the JVM from opening the JAR file.
>  >
>  >
>  > Regards,
>  >
>  > ~ Simon
> >
>
> > On 6/21/07, Adam Winer < awiner@gmail.com> wrote:
> > I think I've found the problem - Trinidad calls
> > URLConnection.getLastModified() in a number
> > of places.  If that's pointing at an URL from
> > inside a JAR, this will implicitly open the
> > JAR file, and not release the file until GC.
> > Looking at solutions now.
> >
>  >
> > -- Adam
> >
>
> > On 6/21/07, Fleischer Peter
> <pe...@munich-airport.de> wrote:
> > The problem is reproducable. After restarting tomcat and some
>  > requests to my application the jar file will again be opened
>  > multiple times. Every (initial?) request to a page increases the
>  > number. Eventually after some time the files are garbage collected.
> >
> > Peter
> > -----Ursprüngliche Nachricht-----
>  > Von: Scott O'Bryan [mailto:darkarena@gmail.com]
>  > Gesendet: Donnerstag, 21. Juni 2007 00:29
>  > An: MyFaces Discussion
>  > Betreff: Re: [Trinidad] Causing Too many open files error?
>
> > I saw this as well using Oracle JDeveloper so I agree that I don't
>  > think this is a Tomcat issue.  I'm not sure what might be causing
>  > this though because I shut down my webserver and restarted it and
>  > everything has been working fine since.
>  >
>  > What happens when you restart tomcat?
>  >
>  > Scott
>
> > On 6/20/07, Fleischer Peter
> <peter.fleischer@munich-airport.de > wrote:
> > Hello,
>  >
>  > we are developing a quite simple application based on MyFaces,
>  > Trinidad and Facelets. After deploying this application to a Tomcat
>  > 5.5.23 and using the application for a while we are facing
>  > connection errors in Tomcat caused by too many open files.
>  >
>  > Checking the running Tomcat process with lsof (list open files) we
>  > discovered, that  <application>/WEB-INF/lib/trinidad-
> impl-1.0.1-
>  > incubating-SNAPSHOT.jar was open for about 300 times. The number
>  > rises with every request. At some time eventually a garbage
>  > collection closes all these files.
>  >
>  > I don't think this is a Tomcat error, because this jar is the only
>  > jar file opened so many times. Perhaps some Trinidad code fails to
>  > close a file? Is this a known issue?
>  >
>  > Many thanks in advance.
>  >
>  > Peter Fleischer
>  >
>  >
> _____________________________________________________________
>  >
>  > Munich Airport International
>  > Flughafen München GmbH
>  > Peter Fleischer
>  > ITED Competence Center Application Development
>  > Support Division Information Technology
>  > P. O. Box  23 17 55
>  > 85326 München
>  > Phone: +49 89 975-3 24 30
>  > Fax: +49 89 975-3 24 06
>  > <mailto:peter.fleischer@munich-airport .de >
>  >
>  > Vorsitzender des Aufsichtsrats: - Chairman of the Supervisory Board:
>  > Staatsminister Prof. Dr. Kurt Faltlhauser
>  > Geschäftsführung: - Executive Board:
>  > Dr. Michael Kerkloh, Walter Vill und Peter Trautmann
>  > Handelsregister: - Commercial Register: RG München, HR-Nr. B 5448
>  > Sitz der Gesellschaft: - Registered Office: München
>  >
> _____________________________________________________________
>
> >
>  >
>  >


-- 
Matthias Wessendorf

further stuff:
blog: http://matthiaswessendorf.wordpress.com/
mail: matzew-at-apache-dot-org

AW: [Trinidad] Causing Too many open files error?

Posted by Fleischer Peter <pe...@munich-airport.de>.
I will get the current snapshot today and do some further testing.

Peter

-----Ursprüngliche Nachricht-----
Von: mwessendorf@gmail.com [mailto:mwessendorf@gmail.com]Im Auftrag von
Matthias Wessendorf
Gesendet: Donnerstag, 5. Juli 2007 10:24
An: MyFaces Discussion
Betreff: Re: [Trinidad] Causing Too many open files error?


The continuum server is back again, and I started the build process manually.

So, inside the Apache M2 snapshot repo ([1]) you'll now find a build
of 102-snap from today (July 5th)

-Matthias

[1] http://people.apache.org/repo/m2-snapshot-repository/

On 7/4/07, Adam Winer <aw...@gmail.com> wrote:
> I'm not reproducing a problem.  At the very
> minimum, in FileInputStream.finalize(), fd.handle always
> seems to be -1 now, whereas it used to be still set
> a lot before.  Admittedly I'm not using Tomcat,
> antiJarLocking or no antiJarLocking.
>
> Is it possible that Matthias gave you a snapshot before
> the fix landed?
>
> -- Adam
>
>
>
> On 7/2/07, Adam Winer <aw...@gmail.com> wrote:
> > Thanks - everything in web.xml seems as it should be.
> > Back to the code for me...
> >
> > -- Adam
> >
> >
> >
> > On 7/1/07, Fleischer Peter <pe...@munich-airport.de> wrote:
> > > Hi Adam,
> > >
> > > there are a lot of open files just after deployment of the application. That's right. And also these files are closed by first GC. But the files listed in my last post are really opened repeatedly and I see more and more of them with every open browser session. The .js files seem to be cached in the browser so the open files are not duplicated every time. But by doing a browser refresh I can increase the number of open files by about 30.
> > >
> > > This is using Tomcat 5.5.23 running with Sun's Java VM 1.5.0_08. This is my web.xml:
> > >
> > > -------------- SNIP --------------------
> > > <?xml version="1.0" encoding="ISO-8859-1"?>
> > > <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
> > >
> > >     <description>Webapplication for Sequence Planning</description>
> > >     <display-name>Weasel</display-name>
> > >
> > >     <context-param>
> > >         <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
> > >         <param-value>true</param-value>
> > >     </context-param>
> > >
> > >     <context-param>
> > >         <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
> > >         <param-value>true</param-value>
> > >     </context-param>
> > >
> > >     <context-param>
> > >         <description>
> > >             Use client-side state saving. In Trinidad, it is an
> > >             optimized, token-based mechanism that is almost always a
> > >             better choice than the standard JSF server-side state saving.
> > >         </description>
> > >         <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
> > >         <param-value>client</param-value>
> > >     </context-param>
> > >
> > >     <context-param>
> > >         <description>
> > >             Konfiguration faces-config.xml in mehrere Dateien aufgeteilt.
> > >         </description>
> > >         <param-name>javax.faces.CONFIG_FILES</param-name>
> > >         <param-value>/WEB-INF/beans.xml,/WEB-INF/navigation.xml</param-value>
> > >     </context-param>
> > >
> > >     <context-param>
> > >         <description>
> > >             ADF Faces also supports an optimized strategy for caching some
> > >             view state at an application level, which significantly improves
> > >             scalability.  However, it makes it harder to develop (updates to
> > >             pages will not be noticed until the server is restarted), and in
> > >             some rare cases cannot be used for some pages (see ADF Faces
> > >             documentation for more information).
> > >         </description>
> > >         <param-name>org.apache.myfaces.trinidad.USE_APPLICATION_VIEW_CACHE</param-name>
> > >         <param-value>true</param-value>
> > >     </context-param>
> > >
> > >     <context-param>
> > >         <description>
> > >             If this parameter is enabled, ADF Faces will automatically
> > >             check the modification date of your JSPs, and discard saved
> > >             state when they change;  this makes development easier,
> > >             but adds overhead that should be avoided when your application
> > >             is deployed.
> > >         </description>
> > >         <param-name>org.apache.myfaces.trinidad.CHECK_FILE_MODIFICATION</param-name>
> > >         <param-value>false</param-value>
> > >     </context-param>
> > >
> > >     <context-param>
> > >         <description>
> > >             Enables Change Persistence at a session scope.  By default,
> > >             Change Persistence is entirely disabled. The ChangeManager is
> > >             an API, which can persist component modifications (like,
> > >             is a showDetail or tree expanded or collapsed). For providing
> > >             a custom Change Persistence implementation inherit from the
> > >             ADF Faces API's ChangeManager class. As the value you have
> > >             to use the fullqualified class name.
> > >         </description>
> > >         <param-name>org.apache.myfaces.trinidad.CHANGE_PERSISTENCE</param-name>
> > >         <param-value>session</param-value>
> > >     </context-param>
> > >
> > >     <context-param>
> > >         <description>
> > >             Über den AlternateViewHandler wird Facelets als ViewHandler in die
> > >             Verkettung der ViewHandler mit aufgenommen.
> > >         </description>
> > >         <param-name>org.apache.myfaces.trinidad.ALTERNATE_VIEW_HANDLER</param-name>
> > >         <param-value>com.sun.facelets.FaceletViewHandler</param-value>
> > >     </context-param>
> > >
> > >     <context-param>
> > >         <description>
> > >             Use Documents Saved as *.xhtml.
> > >         </description>
> > >         <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
> > >         <param-value>.xhtml</param-value>
> > >     </context-param>
> > >
> > >     <context-param>
> > >         <description>
> > >             Special Facelets Debug Output for Development.
> > >         </description>
> > >         <param-name>facelets.DEVELOPMENT</param-name>
> > >         <param-value>false</param-value>
> > >     </context-param>
> > >
> > >
> > >     <context-param>
> > >         <param-name>automaticDataPoller.timeoutSeconds</param-name>
> > >         <param-value>60</param-value>
> > >     </context-param>
> > >     <filter>
> > >         <filter-name>trinidad</filter-name>
> > >         <filter-class>org.apache.myfaces.trinidad.webapp.TrinidadFilter</filter-class>
> > >     </filter>
> > >
> > >     <filter-mapping>
> > >         <filter-name>trinidad</filter-name>
> > >         <servlet-name>faces</servlet-name>
> > >         <dispatcher>REQUEST</dispatcher>
> > >         <dispatcher>ERROR</dispatcher>
> > >     </filter-mapping>
> > >
> > >     <!-- Faces Servlet -->
> > >     <listener>
> > >         <description>Regelmäßige DB-Selects.</description>
> > >         <listener-class>fmg.lf14.weasel.AutomaticDataPoller</listener-class>
> > >     </listener>
> > >     <servlet>
> > >         <description>Faces Servlet</description>
> > >         <servlet-name>faces</servlet-name>
> > >         <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
> > >     </servlet>
> > >
> > >     <!-- resource loader servlet -->
> > >     <servlet>
> > >         <description>Resource Loader servlet für Trinidad.</description>
> > >         <servlet-name>resources</servlet-name>
> > >         <servlet-class>org.apache.myfaces.trinidad.webapp.ResourceServlet</servlet-class>
> > >     </servlet>
> > >
> > >     <servlet>
> > >         <description>Resource Loader servlet für FMG Ressourcen.</description>
> > >         <servlet-name>FMGResources</servlet-name>
> > >         <servlet-class>fmg.lz06.jsfUtil.resource.ResourceServlet</servlet-class>
> > >     </servlet>
> > >
> > >     <servlet>
> > >         <servlet-name>PrintTable</servlet-name>
> > >         <servlet-class>fmg.lf14.weasel.PrintTable</servlet-class>
> > >     </servlet>
> > >
> > >     <!-- Faces Servlet Mappings -->
> > >     <servlet-mapping>
> > >         <servlet-name>faces</servlet-name>
> > >         <url-pattern>/faces/*</url-pattern>
> > >     </servlet-mapping>
> > >
> > >     <servlet-mapping>
> > >         <servlet-name>resources</servlet-name>
> > >         <url-pattern>/adf/*</url-pattern>
> > >     </servlet-mapping>
> > >
> > >     <servlet-mapping>
> > >         <servlet-name>PrintTable</servlet-name>
> > >         <url-pattern>/PrintTable</url-pattern>
> > >     </servlet-mapping>
> > >
> > >     <error-page>
> > >         <error-code>403</error-code>
> > >         <location>/faces/error403.xhtml</location>
> > >     </error-page>
> > >
> > >     <error-page>
> > >         <error-code>404</error-code>
> > >         <location>/faces/error404.xhtml</location>
> > >     </error-page>
> > >
> > >     <error-page>
> > >         <error-code>500</error-code>
> > >         <location>/error500.jsp</location>
> > >     </error-page>
> > >
> > >     <error-page>
> > >         <exception-type>java.lang.Throwable</exception-type>
> > >         <location>/error500.jsp</location>
> > >     </error-page>
> > >
> > >     <error-page>
> > >         <exception-type>java.lang.RuntimeException</exception-type>
> > >         <location>/faces/exception.xhtml</location>
> > >     </error-page>
> > >
> > >     <!-- Container soll nach 30 Minuten für Timeout der Session sorgen. Dies
> > >          ist nur ein zusätzliches Feature zum automatischen Refresh aus der
> > >          layout.xhtml. -->
> > >     <session-config>
> > >         <session-timeout>30</session-timeout>
> > >     </session-config>
> > >
> > >     <welcome-file-list>
> > >         <welcome-file>index.html</welcome-file>
> > >     </welcome-file-list>
> > >
> > >     <security-constraint>
> > >         <display-name>Weasel Gesamt</display-name>
> > >         <web-resource-collection>
> > >             <web-resource-name>secureWeasel</web-resource-name>
> > >             <description/>
> > >             <url-pattern>/faces/pages/*</url-pattern>
> > >         </web-resource-collection>
> > >         <auth-constraint>
> > >             <description/>
> > >             <role-name>weasel</role-name>
> > >         </auth-constraint>
> > >     </security-constraint>
> > >
> > >     <security-constraint>
> > >         <display-name>Weasel Detailansicht</display-name>
> > >         <web-resource-collection>
> > >             <web-resource-name>secureWeaselDetail</web-resource-name>
> > >             <description/>
> > >             <url-pattern>/faces/pages/tableSequenceDetail.xhtml</url-pattern>
> > >         </web-resource-collection>
> > >         <auth-constraint>
> > >             <description/>
> > >             <role-name>weasel-detail</role-name>
> > >         </auth-constraint>
> > >     </security-constraint>
> > >
> > >     <login-config>
> > >         <auth-method>FORM</auth-method>
> > >         <realm-name/>
> > >         <form-login-config>
> > >             <form-login-page>/faces/login.xhtml</form-login-page>
> > >             <form-error-page>/faces/login.xhtml</form-error-page>
> > >         </form-login-config>
> > >     </login-config>
> > >
> > >     <security-role>
> > >         <description>Rolle für prinzipiellen Zugriff auf Weasel.</description>
> > >         <role-name>weasel</role-name>
> > >     </security-role>
> > >
> > >     <security-role>
> > >         <description>Rolle für Zugriff auf Detail-Sequenz.</description>
> > >         <role-name>weasel-detail</role-name>
> > >     </security-role>
> > >
> > >     <resource-ref>
> > >         <res-ref-name>jdbc/myoracle</res-ref-name>
> > >         <res-type>javax.sql.DataSource</res-type>
> > >         <res-auth>Container</res-auth>
> > >         <res-sharing-scope>Shareable</res-sharing-scope>
> > >     </resource-ref>
> > >
> > > </web-app>
> > > ---------------- SNIP -----------------
> > >
> > > Please let me know, if you need to see any other files.
> > >
> > > Peter
> > >
> > >
> > >
> > > -----Ursprüngliche Nachricht-----
> > > Von: Adam Winer [mailto:awiner@gmail.com]
> > > Gesendet: Freitag, 29. Juni 2007 18:03
> > > An: MyFaces Discussion
> > > Betreff: Re: [Trinidad] Causing Too many open files error?
> > >
> > >
> > > These files should at most get locked once, and only at
> > > startup, and the first GC should flush them...  Are you
> > > really seeing repeated locks on these files?  Could
> > > you show your web.xml?
> > >
> > > -- Adam
> > >
> > >
> > >
> > > On 6/29/07, Fleischer Peter <pe...@munich-airport.de> wrote:
> > > >
> > > >
> > > > Hi Adam,
> > > >
> > > > yesterday Matthias sent me a 1.0.2-SNAPSHOT (tanks again!). I did some
> > > > further testing with Tomcat and having the antiJarLocking option set to true
> > > > in the the context.xml. With these settings I think I was able to track down
> > > > the problem to a list of filenames as follows:
> > > >
> > > >
> > > > java    12738 tomcat   65r  VREG         85,40    26783  270804
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/adf/styles/cache/fmg-desktop-1745436599-ie-6-cmp.css
> > > > java    12738 tomcat   66r  VREG         85,40     2961 2719345
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/CharSets.js
> > > > java    12738 tomcat   67r  VREG         85,40    18937 2719361
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/CoreFormat.js
> > > > java    12738 tomcat   68r  VREG         85,40     3292 2719346
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateField.js
> > > > java    12738 tomcat   69r  VREG         85,40      365 2719356
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateFieldFormat.js
> > > > java    12738 tomcat   70r  VREG         85,40    12361 2719350
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateFormat.js
> > > > java    12738 tomcat   71r  VREG         85,40    10945 2719358
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Locale.js
> > > > java    12738 tomcat   72r  VREG         85,40    44505 2719364
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Core.js
> > > > java    12738 tomcat   73r  VREG         85,40     4944 2719342
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Window.js
> > > > java    12738 tomcat   74r  VREG         85,40     3267 2719355
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/TableProxy.js
> > > > java    12738 tomcat   75r  VREG         85,40     1021 2719259
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Poll.js
> > > > java    12738 tomcat   76r  VREG         85,40     2918 2719348
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorField.js
> > > > java    12738 tomcat   77r  VREG         85,40      391 2719357
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorFieldFormat.js
> > > > java    12738 tomcat   78r  VREG         85,40     5857 2719351
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorFormat.js
> > > > java    12738 tomcat   79r  VREG         85,40    18382 2719353
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Shuttle.js
> > > > java    12738 tomcat   80r  VREG         85,40     4648 2719363
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Page.js
> > > > java    12738 tomcat   81r  VREG         85,40      639 2719362
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/StatusIndicator.js
> > > > java    12738 tomcat   82r  VREG         85,40    10520 2791503
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/RequestQueue.js
> > > > java    12738 tomcat   83r  VREG         85,40     2041 2791500
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/XMLRequest.js
> > > > java    12738 tomcat   84r  VREG         85,40     1630 2791501
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/XMLRequestEvent.js
> > > > java    12738 tomcat   85r  VREG         85,40     1594 2791502
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/IFrameXMLRequestEvent.js
> > > > java    12738 tomcat   86r  VREG         85,40       86 2653467
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/images/t.gif
> > > > java    12738 tomcat   87r  VREG         85,40       86 2653467
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/images/t.gif
> > > > java    12738 tomcat   88r  VREG         85,40       86 2653467
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/images/t.gif
> > > > java    12738 tomcat   90r  VREG         85,40    26783  270804
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/adf/styles/cache/fmg-desktop-1745436599-ie-6-cmp.css
> > > > java    12738 tomcat   91r  VREG         85,40    26783  270804
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/adf/styles/cache/fmg-desktop-1745436599-ie-6-cmp.css
> > > > java    12738 tomcat   92r  VREG         85,40     2961 2719345
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/CharSets.js
> > > > java    12738 tomcat   93r  VREG         85,40    18937 2719361
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/CoreFormat.js
> > > > java    12738 tomcat   94r  VREG         85,40     3292 2719346
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateField.js
> > > > java    12738 tomcat   95r  VREG         85,40      365 2719356
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateFieldFormat.js
> > > > java    12738 tomcat   96r  VREG         85,40    12361 2719350
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateFormat.js
> > > > java    12738 tomcat   97r  VREG         85,40    10945 2719358
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Locale.js
> > > > java    12738 tomcat   98r  VREG         85,40    44505 2719364
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Core.js
> > > > java    12738 tomcat   99r  VREG         85,40     4944 2719342
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Window.js
> > > > java    12738 tomcat  100r  VREG         85,40     3267 2719355
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/TableProxy.js
> > > > java    12738 tomcat  101r  VREG         85,40     1021 2719259
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Poll.js
> > > > java    12738 tomcat  102r  VREG         85,40     2918 2719348
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorField.js
> > > > java    12738 tomcat  103r  VREG         85,40      391 2719357
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorFieldFormat.js
> > > > java    12738 tomcat  104r  VREG         85,40     5857 2719351
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorFormat.js
> > > > java    12738 tomcat  105r  VREG         85,40    18382 2719353
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Shuttle.js
> > > > java    12738 tomcat  106r  VREG         85,40     4648 2719363
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Page.js
> > > > java    12738 tomcat  107r  VREG         85,40      639 2719362
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/StatusIndicator.js
> > > > java    12738 tomcat  108r  VREG         85,40    10520 2791503
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/RequestQueue.js
> > > > java    12738 tomcat  109r  VREG         85,40     2041 2791500
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/XMLRequest.js
> > > > java    12738 tomcat  110r  VREG         85,40     1630 2791501
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/XMLRequestEvent.js
> > > > java    12738 tomcat  111r  VREG         85,40     1594 2791502
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/IFrameXMLRequestEvent.js
> > > > java    12738 tomcat  112r  VREG         85,40     2961 2719345
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/CharSets.js
> > > > java    12738 tomcat  113r  VREG         85,40    18937 2719361
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/CoreFormat.js
> > > > java    12738 tomcat  114r  VREG         85,40     3292 2719346
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateField.js
> > > > java    12738 tomcat  115r  VREG         85,40      365 2719356
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateFieldFormat.js
> > > > java    12738 tomcat  116r  VREG         85,40    12361 2719350
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateFormat.js
> > > > java    12738 tomcat  117r  VREG         85,40    10945 2719358
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Locale.js
> > > > java    12738 tomcat  118r  VREG         85,40    44505 2719364
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Core.js
> > > > java    12738 tomcat  119r  VREG         85,40     4944 2719342
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Window.js
> > > > java    12738 tomcat  120r  VREG         85,40     3267 2719355
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/TableProxy.js
> > > > java    12738 tomcat  121r  VREG         85,40     1021 2719259
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Poll.js
> > > > java    12738 tomcat  122r  VREG         85,40     2918 2719348
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorField.js
> > > > java    12738 tomcat  123r  VREG         85,40      391 2719357
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorFieldFormat.js
> > > > java    12738 tomcat  124r  VREG         85,40     5857 2719351
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorFormat.js
> > > > java    12738 tomcat  125r  VREG         85,40    18382 2719353
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Shuttle.js
> > > > java    12738 tomcat  126r  VREG         85,40     4648 2719363
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Page.js
> > > > java    12738 tomcat  127r  VREG         85,40      639 2719362
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/StatusIndicator.js
> > > > java    12738 tomcat  128r  VREG         85,40    10520 2791503
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/RequestQueue.js
> > > > java    12738 tomcat  129r  VREG         85,40     2041 2791500
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/XMLRequest.js
> > > > java    12738 tomcat  130r  VREG         85,40     1630 2791501
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/XMLRequestEvent.js
> > > > java    12738 tomcat  131r  VREG         85,40     1594 2791502
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/IFrameXMLRequestEvent.js
> > > > java    12738 tomcat  133r  VREG         85,40      286 2653419
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/images/list-bullet.gif
> > > > java    12738 tomcat  134r  VREG         85,40      417 2653475
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/images/siready.gif
> > > > java    12738 tomcat  135r  VREG         85,40      781 2653474
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/images/sibusy.gif
> > > >
> > > >
> > > > This was tested with clearing the browser cache in before doing any requests
> > > > to my application and navigating around a little bit. Repeating this test
> > > > with a second browser (also clean cache) duplicated the count of open files.
> > > >
> > > > For now we manually do a GC in our application every 5 minutes to alleviate
> > > > the problem but this is certainly only a quick&dirty solution.
> > > >
> > > > Peter
> > > >
> > > >
> > > > -----Ursprüngliche Nachricht-----
> > > > Von: Adam Winer [mailto:awiner@gmail.com]
> > > > Gesendet: Donnerstag, 21. Juni 2007 23:29
> > > >
> > > > An: MyFaces Discussion
> > > > Betreff: Re: [Trinidad] Causing Too many open files error?
> > > >
> > > >
> > > > On 6/21/07, Simon Lessard <si...@gmail.com> wrote:
> > > > > Hmmm, I assume this is used mainly to detect skin files' version?
> > > >
> > > >
> > > >
> > > > It's used in a bunch of places to detect modification - skin
> > > > files, ResourceServlet, jsp modifications, etc.
> > > > I've checked in a fix that should resolve this,
> > > > but I'm not 100% sure.  I've mostly been looking at
> > > > the calls to FileInputStream.finalize() - there were a
> > > > lot coming in that had still-open FileDescriptors.
> > > > I'd appreciate further testing.
> > > >
> > > >
> > > > It'd be worthwhile to look at optimizing further to block
> > > > any attempt to call getLastModified() on a JAR, but
> > > > for now I'm hoping it'll be enough to close up all URLConnections.
> > > > In a bit of googling, it'd seem that this has bitten a lot
> > > > of developers.
> > > >
> > > >
> > > > -- Adam
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > > Maybe we could create a kind of ResourceDescriptor file that would include
> > > > two URLs, the real one and the container file's (the .jar URL for instance,
> > > > but would be the same as the real URL most of the time). The getLastModified
> > > > method of the ResourceDescriptor could then use that second URL for purpose
> > > > of modification checks, theorically preventing the JVM from opening the JAR
> > > > file.
> > > > >
> > > > >
> > > > > Regards,
> > > > >
> > > > > ~ Simon
> > > > >
> > > > >
> > > > >
> > > > > On 6/21/07, Adam Winer < awiner@gmail.com> wrote:
> > > > > > I think I've found the problem - Trinidad calls
> > > > > > URLConnection.getLastModified() in a number
> > > > > > of places.  If that's pointing at an URL from
> > > > > > inside a JAR, this will implicitly open the
> > > > > > JAR file, and not release the file until GC.
> > > > > > Looking at solutions now.
> > > > > >
> > > > > >
> > > > > > -- Adam
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > On 6/21/07, Fleischer Peter
> > > > <pe...@munich-airport.de> wrote:
> > > > > > >
> > > > > > >
> > > > > > > The problem is reproducable. After restarting tomcat and some requests
> > > > to my application the jar file will again be opened multiple times. Every
> > > > (initial?) request to a page increases the number. Eventually after some
> > > > time the files are garbage collected.
> > > > > > >
> > > > > > > Peter
> > > > > > >
> > > > > > > -----Ursprüngliche Nachricht-----
> > > > > > > Von: Scott O'Bryan [mailto:darkarena@gmail.com]
> > > > > > > Gesendet: Donnerstag, 21. Juni 2007 00:29
> > > > > > > An: MyFaces Discussion
> > > > > > > Betreff: Re: [Trinidad] Causing Too many open files error?
> > > > > > >
> > > > > > >
> > > > > > > I saw this as well using Oracle JDeveloper so I agree that I don't
> > > > think this is a Tomcat issue.  I'm not sure what might be causing this
> > > > though because I shut down my webserver and restarted it and everything has
> > > > been working fine since.
> > > > > > >
> > > > > > > What happens when you restart tomcat?
> > > > > > >
> > > > > > > Scott
> > > > > > >
> > > > > > >
> > > > > > > On 6/20/07, Fleischer Peter
> > > > <peter.fleischer@munich-airport.de > wrote:
> > > > > > > > Hello,
> > > > > > > >
> > > > > > > > we are developing a quite simple application based on MyFaces,
> > > > Trinidad and Facelets. After deploying this application to a Tomcat 5.5.23
> > > > and using the application for a while we are facing connection errors in
> > > > Tomcat caused by too many open files.
> > > > > > > >
> > > > > > > > Checking the running Tomcat process with lsof (list open files) we
> > > > discovered, that  <application>/WEB-INF/lib/trinidad-
> > > > impl-1.0.1-incubating-SNAPSHOT.jar was open for about 300
> > > > times. The number rises with every request. At some time eventually a
> > > > garbage collection closes all these files.
> > > > > > > >
> > > > > > > > I don't think this is a Tomcat error, because this jar is the only
> > > > jar file opened so many times. Perhaps some Trinidad code fails to close a
> > > > file? Is this a known issue?
> > > > > > > >
> > > > > > > > Many thanks in advance.
> > > > > > > >
> > > > > > > > Peter Fleischer
> > > > > > > >
> > > > > > > >
> > > > _____________________________________________________________
> > > > > > > >
> > > > > > > > Munich Airport International
> > > > > > > > Flughafen München GmbH
> > > > > > > > Peter Fleischer
> > > > > > > > ITED Competence Center Application Development
> > > > > > > > Support Division Information Technology
> > > > > > > > P. O. Box  23 17 55
> > > > > > > > 85326 München
> > > > > > > > Phone: +49 89 975-3 24 30
> > > > > > > > Fax: +49 89 975-3 24 06
> > > > > > > > <mailto:peter.fleischer@munich-airport .de >
> > > > > > > >
> > > > > > > > Vorsitzender des Aufsichtsrats: - Chairman of the Supervisory Board:
> > > > > > > > Staatsminister Prof. Dr. Kurt Faltlhauser
> > > > > > > > Geschäftsführung: - Executive Board:
> > > > > > > > Dr. Michael Kerkloh, Walter Vill und Peter Trautmann
> > > > > > > > Handelsregister: - Commercial Register: RG München, HR-Nr. B 5448
> > > > > > > > Sitz der Gesellschaft: - Registered Office: München
> > > > > > > >
> > > > _____________________________________________________________
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> >
>


-- 
Matthias Wessendorf

further stuff:
blog: http://matthiaswessendorf.wordpress.com/
mail: matzew-at-apache-dot-org

Re: [Trinidad] Causing Too many open files error?

Posted by Matthias Wessendorf <ma...@apache.org>.
The continuum server is back again, and I started the build process manually.

So, inside the Apache M2 snapshot repo ([1]) you'll now find a build
of 102-snap from today (July 5th)

-Matthias

[1] http://people.apache.org/repo/m2-snapshot-repository/

On 7/4/07, Adam Winer <aw...@gmail.com> wrote:
> I'm not reproducing a problem.  At the very
> minimum, in FileInputStream.finalize(), fd.handle always
> seems to be -1 now, whereas it used to be still set
> a lot before.  Admittedly I'm not using Tomcat,
> antiJarLocking or no antiJarLocking.
>
> Is it possible that Matthias gave you a snapshot before
> the fix landed?
>
> -- Adam
>
>
>
> On 7/2/07, Adam Winer <aw...@gmail.com> wrote:
> > Thanks - everything in web.xml seems as it should be.
> > Back to the code for me...
> >
> > -- Adam
> >
> >
> >
> > On 7/1/07, Fleischer Peter <pe...@munich-airport.de> wrote:
> > > Hi Adam,
> > >
> > > there are a lot of open files just after deployment of the application. That's right. And also these files are closed by first GC. But the files listed in my last post are really opened repeatedly and I see more and more of them with every open browser session. The .js files seem to be cached in the browser so the open files are not duplicated every time. But by doing a browser refresh I can increase the number of open files by about 30.
> > >
> > > This is using Tomcat 5.5.23 running with Sun's Java VM 1.5.0_08. This is my web.xml:
> > >
> > > -------------- SNIP --------------------
> > > <?xml version="1.0" encoding="ISO-8859-1"?>
> > > <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
> > >
> > >     <description>Webapplication for Sequence Planning</description>
> > >     <display-name>Weasel</display-name>
> > >
> > >     <context-param>
> > >         <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
> > >         <param-value>true</param-value>
> > >     </context-param>
> > >
> > >     <context-param>
> > >         <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
> > >         <param-value>true</param-value>
> > >     </context-param>
> > >
> > >     <context-param>
> > >         <description>
> > >             Use client-side state saving. In Trinidad, it is an
> > >             optimized, token-based mechanism that is almost always a
> > >             better choice than the standard JSF server-side state saving.
> > >         </description>
> > >         <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
> > >         <param-value>client</param-value>
> > >     </context-param>
> > >
> > >     <context-param>
> > >         <description>
> > >             Konfiguration faces-config.xml in mehrere Dateien aufgeteilt.
> > >         </description>
> > >         <param-name>javax.faces.CONFIG_FILES</param-name>
> > >         <param-value>/WEB-INF/beans.xml,/WEB-INF/navigation.xml</param-value>
> > >     </context-param>
> > >
> > >     <context-param>
> > >         <description>
> > >             ADF Faces also supports an optimized strategy for caching some
> > >             view state at an application level, which significantly improves
> > >             scalability.  However, it makes it harder to develop (updates to
> > >             pages will not be noticed until the server is restarted), and in
> > >             some rare cases cannot be used for some pages (see ADF Faces
> > >             documentation for more information).
> > >         </description>
> > >         <param-name>org.apache.myfaces.trinidad.USE_APPLICATION_VIEW_CACHE</param-name>
> > >         <param-value>true</param-value>
> > >     </context-param>
> > >
> > >     <context-param>
> > >         <description>
> > >             If this parameter is enabled, ADF Faces will automatically
> > >             check the modification date of your JSPs, and discard saved
> > >             state when they change;  this makes development easier,
> > >             but adds overhead that should be avoided when your application
> > >             is deployed.
> > >         </description>
> > >         <param-name>org.apache.myfaces.trinidad.CHECK_FILE_MODIFICATION</param-name>
> > >         <param-value>false</param-value>
> > >     </context-param>
> > >
> > >     <context-param>
> > >         <description>
> > >             Enables Change Persistence at a session scope.  By default,
> > >             Change Persistence is entirely disabled. The ChangeManager is
> > >             an API, which can persist component modifications (like,
> > >             is a showDetail or tree expanded or collapsed). For providing
> > >             a custom Change Persistence implementation inherit from the
> > >             ADF Faces API's ChangeManager class. As the value you have
> > >             to use the fullqualified class name.
> > >         </description>
> > >         <param-name>org.apache.myfaces.trinidad.CHANGE_PERSISTENCE</param-name>
> > >         <param-value>session</param-value>
> > >     </context-param>
> > >
> > >     <context-param>
> > >         <description>
> > >             Über den AlternateViewHandler wird Facelets als ViewHandler in die
> > >             Verkettung der ViewHandler mit aufgenommen.
> > >         </description>
> > >         <param-name>org.apache.myfaces.trinidad.ALTERNATE_VIEW_HANDLER</param-name>
> > >         <param-value>com.sun.facelets.FaceletViewHandler</param-value>
> > >     </context-param>
> > >
> > >     <context-param>
> > >         <description>
> > >             Use Documents Saved as *.xhtml.
> > >         </description>
> > >         <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
> > >         <param-value>.xhtml</param-value>
> > >     </context-param>
> > >
> > >     <context-param>
> > >         <description>
> > >             Special Facelets Debug Output for Development.
> > >         </description>
> > >         <param-name>facelets.DEVELOPMENT</param-name>
> > >         <param-value>false</param-value>
> > >     </context-param>
> > >
> > >
> > >     <context-param>
> > >         <param-name>automaticDataPoller.timeoutSeconds</param-name>
> > >         <param-value>60</param-value>
> > >     </context-param>
> > >     <filter>
> > >         <filter-name>trinidad</filter-name>
> > >         <filter-class>org.apache.myfaces.trinidad.webapp.TrinidadFilter</filter-class>
> > >     </filter>
> > >
> > >     <filter-mapping>
> > >         <filter-name>trinidad</filter-name>
> > >         <servlet-name>faces</servlet-name>
> > >         <dispatcher>REQUEST</dispatcher>
> > >         <dispatcher>ERROR</dispatcher>
> > >     </filter-mapping>
> > >
> > >     <!-- Faces Servlet -->
> > >     <listener>
> > >         <description>Regelmäßige DB-Selects.</description>
> > >         <listener-class>fmg.lf14.weasel.AutomaticDataPoller</listener-class>
> > >     </listener>
> > >     <servlet>
> > >         <description>Faces Servlet</description>
> > >         <servlet-name>faces</servlet-name>
> > >         <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
> > >     </servlet>
> > >
> > >     <!-- resource loader servlet -->
> > >     <servlet>
> > >         <description>Resource Loader servlet für Trinidad.</description>
> > >         <servlet-name>resources</servlet-name>
> > >         <servlet-class>org.apache.myfaces.trinidad.webapp.ResourceServlet</servlet-class>
> > >     </servlet>
> > >
> > >     <servlet>
> > >         <description>Resource Loader servlet für FMG Ressourcen.</description>
> > >         <servlet-name>FMGResources</servlet-name>
> > >         <servlet-class>fmg.lz06.jsfUtil.resource.ResourceServlet</servlet-class>
> > >     </servlet>
> > >
> > >     <servlet>
> > >         <servlet-name>PrintTable</servlet-name>
> > >         <servlet-class>fmg.lf14.weasel.PrintTable</servlet-class>
> > >     </servlet>
> > >
> > >     <!-- Faces Servlet Mappings -->
> > >     <servlet-mapping>
> > >         <servlet-name>faces</servlet-name>
> > >         <url-pattern>/faces/*</url-pattern>
> > >     </servlet-mapping>
> > >
> > >     <servlet-mapping>
> > >         <servlet-name>resources</servlet-name>
> > >         <url-pattern>/adf/*</url-pattern>
> > >     </servlet-mapping>
> > >
> > >     <servlet-mapping>
> > >         <servlet-name>PrintTable</servlet-name>
> > >         <url-pattern>/PrintTable</url-pattern>
> > >     </servlet-mapping>
> > >
> > >     <error-page>
> > >         <error-code>403</error-code>
> > >         <location>/faces/error403.xhtml</location>
> > >     </error-page>
> > >
> > >     <error-page>
> > >         <error-code>404</error-code>
> > >         <location>/faces/error404.xhtml</location>
> > >     </error-page>
> > >
> > >     <error-page>
> > >         <error-code>500</error-code>
> > >         <location>/error500.jsp</location>
> > >     </error-page>
> > >
> > >     <error-page>
> > >         <exception-type>java.lang.Throwable</exception-type>
> > >         <location>/error500.jsp</location>
> > >     </error-page>
> > >
> > >     <error-page>
> > >         <exception-type>java.lang.RuntimeException</exception-type>
> > >         <location>/faces/exception.xhtml</location>
> > >     </error-page>
> > >
> > >     <!-- Container soll nach 30 Minuten für Timeout der Session sorgen. Dies
> > >          ist nur ein zusätzliches Feature zum automatischen Refresh aus der
> > >          layout.xhtml. -->
> > >     <session-config>
> > >         <session-timeout>30</session-timeout>
> > >     </session-config>
> > >
> > >     <welcome-file-list>
> > >         <welcome-file>index.html</welcome-file>
> > >     </welcome-file-list>
> > >
> > >     <security-constraint>
> > >         <display-name>Weasel Gesamt</display-name>
> > >         <web-resource-collection>
> > >             <web-resource-name>secureWeasel</web-resource-name>
> > >             <description/>
> > >             <url-pattern>/faces/pages/*</url-pattern>
> > >         </web-resource-collection>
> > >         <auth-constraint>
> > >             <description/>
> > >             <role-name>weasel</role-name>
> > >         </auth-constraint>
> > >     </security-constraint>
> > >
> > >     <security-constraint>
> > >         <display-name>Weasel Detailansicht</display-name>
> > >         <web-resource-collection>
> > >             <web-resource-name>secureWeaselDetail</web-resource-name>
> > >             <description/>
> > >             <url-pattern>/faces/pages/tableSequenceDetail.xhtml</url-pattern>
> > >         </web-resource-collection>
> > >         <auth-constraint>
> > >             <description/>
> > >             <role-name>weasel-detail</role-name>
> > >         </auth-constraint>
> > >     </security-constraint>
> > >
> > >     <login-config>
> > >         <auth-method>FORM</auth-method>
> > >         <realm-name/>
> > >         <form-login-config>
> > >             <form-login-page>/faces/login.xhtml</form-login-page>
> > >             <form-error-page>/faces/login.xhtml</form-error-page>
> > >         </form-login-config>
> > >     </login-config>
> > >
> > >     <security-role>
> > >         <description>Rolle für prinzipiellen Zugriff auf Weasel.</description>
> > >         <role-name>weasel</role-name>
> > >     </security-role>
> > >
> > >     <security-role>
> > >         <description>Rolle für Zugriff auf Detail-Sequenz.</description>
> > >         <role-name>weasel-detail</role-name>
> > >     </security-role>
> > >
> > >     <resource-ref>
> > >         <res-ref-name>jdbc/myoracle</res-ref-name>
> > >         <res-type>javax.sql.DataSource</res-type>
> > >         <res-auth>Container</res-auth>
> > >         <res-sharing-scope>Shareable</res-sharing-scope>
> > >     </resource-ref>
> > >
> > > </web-app>
> > > ---------------- SNIP -----------------
> > >
> > > Please let me know, if you need to see any other files.
> > >
> > > Peter
> > >
> > >
> > >
> > > -----Ursprüngliche Nachricht-----
> > > Von: Adam Winer [mailto:awiner@gmail.com]
> > > Gesendet: Freitag, 29. Juni 2007 18:03
> > > An: MyFaces Discussion
> > > Betreff: Re: [Trinidad] Causing Too many open files error?
> > >
> > >
> > > These files should at most get locked once, and only at
> > > startup, and the first GC should flush them...  Are you
> > > really seeing repeated locks on these files?  Could
> > > you show your web.xml?
> > >
> > > -- Adam
> > >
> > >
> > >
> > > On 6/29/07, Fleischer Peter <pe...@munich-airport.de> wrote:
> > > >
> > > >
> > > > Hi Adam,
> > > >
> > > > yesterday Matthias sent me a 1.0.2-SNAPSHOT (tanks again!). I did some
> > > > further testing with Tomcat and having the antiJarLocking option set to true
> > > > in the the context.xml. With these settings I think I was able to track down
> > > > the problem to a list of filenames as follows:
> > > >
> > > >
> > > > java    12738 tomcat   65r  VREG         85,40    26783  270804
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/adf/styles/cache/fmg-desktop-1745436599-ie-6-cmp.css
> > > > java    12738 tomcat   66r  VREG         85,40     2961 2719345
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/CharSets.js
> > > > java    12738 tomcat   67r  VREG         85,40    18937 2719361
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/CoreFormat.js
> > > > java    12738 tomcat   68r  VREG         85,40     3292 2719346
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateField.js
> > > > java    12738 tomcat   69r  VREG         85,40      365 2719356
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateFieldFormat.js
> > > > java    12738 tomcat   70r  VREG         85,40    12361 2719350
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateFormat.js
> > > > java    12738 tomcat   71r  VREG         85,40    10945 2719358
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Locale.js
> > > > java    12738 tomcat   72r  VREG         85,40    44505 2719364
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Core.js
> > > > java    12738 tomcat   73r  VREG         85,40     4944 2719342
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Window.js
> > > > java    12738 tomcat   74r  VREG         85,40     3267 2719355
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/TableProxy.js
> > > > java    12738 tomcat   75r  VREG         85,40     1021 2719259
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Poll.js
> > > > java    12738 tomcat   76r  VREG         85,40     2918 2719348
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorField.js
> > > > java    12738 tomcat   77r  VREG         85,40      391 2719357
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorFieldFormat.js
> > > > java    12738 tomcat   78r  VREG         85,40     5857 2719351
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorFormat.js
> > > > java    12738 tomcat   79r  VREG         85,40    18382 2719353
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Shuttle.js
> > > > java    12738 tomcat   80r  VREG         85,40     4648 2719363
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Page.js
> > > > java    12738 tomcat   81r  VREG         85,40      639 2719362
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/StatusIndicator.js
> > > > java    12738 tomcat   82r  VREG         85,40    10520 2791503
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/RequestQueue.js
> > > > java    12738 tomcat   83r  VREG         85,40     2041 2791500
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/XMLRequest.js
> > > > java    12738 tomcat   84r  VREG         85,40     1630 2791501
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/XMLRequestEvent.js
> > > > java    12738 tomcat   85r  VREG         85,40     1594 2791502
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/IFrameXMLRequestEvent.js
> > > > java    12738 tomcat   86r  VREG         85,40       86 2653467
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/images/t.gif
> > > > java    12738 tomcat   87r  VREG         85,40       86 2653467
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/images/t.gif
> > > > java    12738 tomcat   88r  VREG         85,40       86 2653467
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/images/t.gif
> > > > java    12738 tomcat   90r  VREG         85,40    26783  270804
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/adf/styles/cache/fmg-desktop-1745436599-ie-6-cmp.css
> > > > java    12738 tomcat   91r  VREG         85,40    26783  270804
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/adf/styles/cache/fmg-desktop-1745436599-ie-6-cmp.css
> > > > java    12738 tomcat   92r  VREG         85,40     2961 2719345
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/CharSets.js
> > > > java    12738 tomcat   93r  VREG         85,40    18937 2719361
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/CoreFormat.js
> > > > java    12738 tomcat   94r  VREG         85,40     3292 2719346
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateField.js
> > > > java    12738 tomcat   95r  VREG         85,40      365 2719356
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateFieldFormat.js
> > > > java    12738 tomcat   96r  VREG         85,40    12361 2719350
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateFormat.js
> > > > java    12738 tomcat   97r  VREG         85,40    10945 2719358
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Locale.js
> > > > java    12738 tomcat   98r  VREG         85,40    44505 2719364
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Core.js
> > > > java    12738 tomcat   99r  VREG         85,40     4944 2719342
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Window.js
> > > > java    12738 tomcat  100r  VREG         85,40     3267 2719355
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/TableProxy.js
> > > > java    12738 tomcat  101r  VREG         85,40     1021 2719259
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Poll.js
> > > > java    12738 tomcat  102r  VREG         85,40     2918 2719348
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorField.js
> > > > java    12738 tomcat  103r  VREG         85,40      391 2719357
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorFieldFormat.js
> > > > java    12738 tomcat  104r  VREG         85,40     5857 2719351
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorFormat.js
> > > > java    12738 tomcat  105r  VREG         85,40    18382 2719353
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Shuttle.js
> > > > java    12738 tomcat  106r  VREG         85,40     4648 2719363
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Page.js
> > > > java    12738 tomcat  107r  VREG         85,40      639 2719362
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/StatusIndicator.js
> > > > java    12738 tomcat  108r  VREG         85,40    10520 2791503
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/RequestQueue.js
> > > > java    12738 tomcat  109r  VREG         85,40     2041 2791500
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/XMLRequest.js
> > > > java    12738 tomcat  110r  VREG         85,40     1630 2791501
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/XMLRequestEvent.js
> > > > java    12738 tomcat  111r  VREG         85,40     1594 2791502
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/IFrameXMLRequestEvent.js
> > > > java    12738 tomcat  112r  VREG         85,40     2961 2719345
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/CharSets.js
> > > > java    12738 tomcat  113r  VREG         85,40    18937 2719361
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/CoreFormat.js
> > > > java    12738 tomcat  114r  VREG         85,40     3292 2719346
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateField.js
> > > > java    12738 tomcat  115r  VREG         85,40      365 2719356
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateFieldFormat.js
> > > > java    12738 tomcat  116r  VREG         85,40    12361 2719350
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateFormat.js
> > > > java    12738 tomcat  117r  VREG         85,40    10945 2719358
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Locale.js
> > > > java    12738 tomcat  118r  VREG         85,40    44505 2719364
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Core.js
> > > > java    12738 tomcat  119r  VREG         85,40     4944 2719342
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Window.js
> > > > java    12738 tomcat  120r  VREG         85,40     3267 2719355
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/TableProxy.js
> > > > java    12738 tomcat  121r  VREG         85,40     1021 2719259
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Poll.js
> > > > java    12738 tomcat  122r  VREG         85,40     2918 2719348
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorField.js
> > > > java    12738 tomcat  123r  VREG         85,40      391 2719357
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorFieldFormat.js
> > > > java    12738 tomcat  124r  VREG         85,40     5857 2719351
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorFormat.js
> > > > java    12738 tomcat  125r  VREG         85,40    18382 2719353
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Shuttle.js
> > > > java    12738 tomcat  126r  VREG         85,40     4648 2719363
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Page.js
> > > > java    12738 tomcat  127r  VREG         85,40      639 2719362
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/StatusIndicator.js
> > > > java    12738 tomcat  128r  VREG         85,40    10520 2791503
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/RequestQueue.js
> > > > java    12738 tomcat  129r  VREG         85,40     2041 2791500
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/XMLRequest.js
> > > > java    12738 tomcat  130r  VREG         85,40     1630 2791501
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/XMLRequestEvent.js
> > > > java    12738 tomcat  131r  VREG         85,40     1594 2791502
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/IFrameXMLRequestEvent.js
> > > > java    12738 tomcat  133r  VREG         85,40      286 2653419
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/images/list-bullet.gif
> > > > java    12738 tomcat  134r  VREG         85,40      417 2653475
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/images/siready.gif
> > > > java    12738 tomcat  135r  VREG         85,40      781 2653474
> > > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/images/sibusy.gif
> > > >
> > > >
> > > > This was tested with clearing the browser cache in before doing any requests
> > > > to my application and navigating around a little bit. Repeating this test
> > > > with a second browser (also clean cache) duplicated the count of open files.
> > > >
> > > > For now we manually do a GC in our application every 5 minutes to alleviate
> > > > the problem but this is certainly only a quick&dirty solution.
> > > >
> > > > Peter
> > > >
> > > >
> > > > -----Ursprüngliche Nachricht-----
> > > > Von: Adam Winer [mailto:awiner@gmail.com]
> > > > Gesendet: Donnerstag, 21. Juni 2007 23:29
> > > >
> > > > An: MyFaces Discussion
> > > > Betreff: Re: [Trinidad] Causing Too many open files error?
> > > >
> > > >
> > > > On 6/21/07, Simon Lessard <si...@gmail.com> wrote:
> > > > > Hmmm, I assume this is used mainly to detect skin files' version?
> > > >
> > > >
> > > >
> > > > It's used in a bunch of places to detect modification - skin
> > > > files, ResourceServlet, jsp modifications, etc.
> > > > I've checked in a fix that should resolve this,
> > > > but I'm not 100% sure.  I've mostly been looking at
> > > > the calls to FileInputStream.finalize() - there were a
> > > > lot coming in that had still-open FileDescriptors.
> > > > I'd appreciate further testing.
> > > >
> > > >
> > > > It'd be worthwhile to look at optimizing further to block
> > > > any attempt to call getLastModified() on a JAR, but
> > > > for now I'm hoping it'll be enough to close up all URLConnections.
> > > > In a bit of googling, it'd seem that this has bitten a lot
> > > > of developers.
> > > >
> > > >
> > > > -- Adam
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > > Maybe we could create a kind of ResourceDescriptor file that would include
> > > > two URLs, the real one and the container file's (the .jar URL for instance,
> > > > but would be the same as the real URL most of the time). The getLastModified
> > > > method of the ResourceDescriptor could then use that second URL for purpose
> > > > of modification checks, theorically preventing the JVM from opening the JAR
> > > > file.
> > > > >
> > > > >
> > > > > Regards,
> > > > >
> > > > > ~ Simon
> > > > >
> > > > >
> > > > >
> > > > > On 6/21/07, Adam Winer < awiner@gmail.com> wrote:
> > > > > > I think I've found the problem - Trinidad calls
> > > > > > URLConnection.getLastModified() in a number
> > > > > > of places.  If that's pointing at an URL from
> > > > > > inside a JAR, this will implicitly open the
> > > > > > JAR file, and not release the file until GC.
> > > > > > Looking at solutions now.
> > > > > >
> > > > > >
> > > > > > -- Adam
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > On 6/21/07, Fleischer Peter
> > > > <pe...@munich-airport.de> wrote:
> > > > > > >
> > > > > > >
> > > > > > > The problem is reproducable. After restarting tomcat and some requests
> > > > to my application the jar file will again be opened multiple times. Every
> > > > (initial?) request to a page increases the number. Eventually after some
> > > > time the files are garbage collected.
> > > > > > >
> > > > > > > Peter
> > > > > > >
> > > > > > > -----Ursprüngliche Nachricht-----
> > > > > > > Von: Scott O'Bryan [mailto:darkarena@gmail.com]
> > > > > > > Gesendet: Donnerstag, 21. Juni 2007 00:29
> > > > > > > An: MyFaces Discussion
> > > > > > > Betreff: Re: [Trinidad] Causing Too many open files error?
> > > > > > >
> > > > > > >
> > > > > > > I saw this as well using Oracle JDeveloper so I agree that I don't
> > > > think this is a Tomcat issue.  I'm not sure what might be causing this
> > > > though because I shut down my webserver and restarted it and everything has
> > > > been working fine since.
> > > > > > >
> > > > > > > What happens when you restart tomcat?
> > > > > > >
> > > > > > > Scott
> > > > > > >
> > > > > > >
> > > > > > > On 6/20/07, Fleischer Peter
> > > > <peter.fleischer@munich-airport.de > wrote:
> > > > > > > > Hello,
> > > > > > > >
> > > > > > > > we are developing a quite simple application based on MyFaces,
> > > > Trinidad and Facelets. After deploying this application to a Tomcat 5.5.23
> > > > and using the application for a while we are facing connection errors in
> > > > Tomcat caused by too many open files.
> > > > > > > >
> > > > > > > > Checking the running Tomcat process with lsof (list open files) we
> > > > discovered, that  <application>/WEB-INF/lib/trinidad-
> > > > impl-1.0.1-incubating-SNAPSHOT.jar was open for about 300
> > > > times. The number rises with every request. At some time eventually a
> > > > garbage collection closes all these files.
> > > > > > > >
> > > > > > > > I don't think this is a Tomcat error, because this jar is the only
> > > > jar file opened so many times. Perhaps some Trinidad code fails to close a
> > > > file? Is this a known issue?
> > > > > > > >
> > > > > > > > Many thanks in advance.
> > > > > > > >
> > > > > > > > Peter Fleischer
> > > > > > > >
> > > > > > > >
> > > > _____________________________________________________________
> > > > > > > >
> > > > > > > > Munich Airport International
> > > > > > > > Flughafen München GmbH
> > > > > > > > Peter Fleischer
> > > > > > > > ITED Competence Center Application Development
> > > > > > > > Support Division Information Technology
> > > > > > > > P. O. Box  23 17 55
> > > > > > > > 85326 München
> > > > > > > > Phone: +49 89 975-3 24 30
> > > > > > > > Fax: +49 89 975-3 24 06
> > > > > > > > <mailto:peter.fleischer@munich-airport .de >
> > > > > > > >
> > > > > > > > Vorsitzender des Aufsichtsrats: - Chairman of the Supervisory Board:
> > > > > > > > Staatsminister Prof. Dr. Kurt Faltlhauser
> > > > > > > > Geschäftsführung: - Executive Board:
> > > > > > > > Dr. Michael Kerkloh, Walter Vill und Peter Trautmann
> > > > > > > > Handelsregister: - Commercial Register: RG München, HR-Nr. B 5448
> > > > > > > > Sitz der Gesellschaft: - Registered Office: München
> > > > > > > >
> > > > _____________________________________________________________
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> >
>


-- 
Matthias Wessendorf

further stuff:
blog: http://matthiaswessendorf.wordpress.com/
mail: matzew-at-apache-dot-org

Re: [Trinidad] Causing Too many open files error?

Posted by Adam Winer <aw...@gmail.com>.
I'm not reproducing a problem.  At the very
minimum, in FileInputStream.finalize(), fd.handle always
seems to be -1 now, whereas it used to be still set
a lot before.  Admittedly I'm not using Tomcat,
antiJarLocking or no antiJarLocking.

Is it possible that Matthias gave you a snapshot before
the fix landed?

-- Adam



On 7/2/07, Adam Winer <aw...@gmail.com> wrote:
> Thanks - everything in web.xml seems as it should be.
> Back to the code for me...
>
> -- Adam
>
>
>
> On 7/1/07, Fleischer Peter <pe...@munich-airport.de> wrote:
> > Hi Adam,
> >
> > there are a lot of open files just after deployment of the application. That's right. And also these files are closed by first GC. But the files listed in my last post are really opened repeatedly and I see more and more of them with every open browser session. The .js files seem to be cached in the browser so the open files are not duplicated every time. But by doing a browser refresh I can increase the number of open files by about 30.
> >
> > This is using Tomcat 5.5.23 running with Sun's Java VM 1.5.0_08. This is my web.xml:
> >
> > -------------- SNIP --------------------
> > <?xml version="1.0" encoding="ISO-8859-1"?>
> > <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
> >
> >     <description>Webapplication for Sequence Planning</description>
> >     <display-name>Weasel</display-name>
> >
> >     <context-param>
> >         <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
> >         <param-value>true</param-value>
> >     </context-param>
> >
> >     <context-param>
> >         <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
> >         <param-value>true</param-value>
> >     </context-param>
> >
> >     <context-param>
> >         <description>
> >             Use client-side state saving. In Trinidad, it is an
> >             optimized, token-based mechanism that is almost always a
> >             better choice than the standard JSF server-side state saving.
> >         </description>
> >         <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
> >         <param-value>client</param-value>
> >     </context-param>
> >
> >     <context-param>
> >         <description>
> >             Konfiguration faces-config.xml in mehrere Dateien aufgeteilt.
> >         </description>
> >         <param-name>javax.faces.CONFIG_FILES</param-name>
> >         <param-value>/WEB-INF/beans.xml,/WEB-INF/navigation.xml</param-value>
> >     </context-param>
> >
> >     <context-param>
> >         <description>
> >             ADF Faces also supports an optimized strategy for caching some
> >             view state at an application level, which significantly improves
> >             scalability.  However, it makes it harder to develop (updates to
> >             pages will not be noticed until the server is restarted), and in
> >             some rare cases cannot be used for some pages (see ADF Faces
> >             documentation for more information).
> >         </description>
> >         <param-name>org.apache.myfaces.trinidad.USE_APPLICATION_VIEW_CACHE</param-name>
> >         <param-value>true</param-value>
> >     </context-param>
> >
> >     <context-param>
> >         <description>
> >             If this parameter is enabled, ADF Faces will automatically
> >             check the modification date of your JSPs, and discard saved
> >             state when they change;  this makes development easier,
> >             but adds overhead that should be avoided when your application
> >             is deployed.
> >         </description>
> >         <param-name>org.apache.myfaces.trinidad.CHECK_FILE_MODIFICATION</param-name>
> >         <param-value>false</param-value>
> >     </context-param>
> >
> >     <context-param>
> >         <description>
> >             Enables Change Persistence at a session scope.  By default,
> >             Change Persistence is entirely disabled. The ChangeManager is
> >             an API, which can persist component modifications (like,
> >             is a showDetail or tree expanded or collapsed). For providing
> >             a custom Change Persistence implementation inherit from the
> >             ADF Faces API's ChangeManager class. As the value you have
> >             to use the fullqualified class name.
> >         </description>
> >         <param-name>org.apache.myfaces.trinidad.CHANGE_PERSISTENCE</param-name>
> >         <param-value>session</param-value>
> >     </context-param>
> >
> >     <context-param>
> >         <description>
> >             Über den AlternateViewHandler wird Facelets als ViewHandler in die
> >             Verkettung der ViewHandler mit aufgenommen.
> >         </description>
> >         <param-name>org.apache.myfaces.trinidad.ALTERNATE_VIEW_HANDLER</param-name>
> >         <param-value>com.sun.facelets.FaceletViewHandler</param-value>
> >     </context-param>
> >
> >     <context-param>
> >         <description>
> >             Use Documents Saved as *.xhtml.
> >         </description>
> >         <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
> >         <param-value>.xhtml</param-value>
> >     </context-param>
> >
> >     <context-param>
> >         <description>
> >             Special Facelets Debug Output for Development.
> >         </description>
> >         <param-name>facelets.DEVELOPMENT</param-name>
> >         <param-value>false</param-value>
> >     </context-param>
> >
> >
> >     <context-param>
> >         <param-name>automaticDataPoller.timeoutSeconds</param-name>
> >         <param-value>60</param-value>
> >     </context-param>
> >     <filter>
> >         <filter-name>trinidad</filter-name>
> >         <filter-class>org.apache.myfaces.trinidad.webapp.TrinidadFilter</filter-class>
> >     </filter>
> >
> >     <filter-mapping>
> >         <filter-name>trinidad</filter-name>
> >         <servlet-name>faces</servlet-name>
> >         <dispatcher>REQUEST</dispatcher>
> >         <dispatcher>ERROR</dispatcher>
> >     </filter-mapping>
> >
> >     <!-- Faces Servlet -->
> >     <listener>
> >         <description>Regelmäßige DB-Selects.</description>
> >         <listener-class>fmg.lf14.weasel.AutomaticDataPoller</listener-class>
> >     </listener>
> >     <servlet>
> >         <description>Faces Servlet</description>
> >         <servlet-name>faces</servlet-name>
> >         <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
> >     </servlet>
> >
> >     <!-- resource loader servlet -->
> >     <servlet>
> >         <description>Resource Loader servlet für Trinidad.</description>
> >         <servlet-name>resources</servlet-name>
> >         <servlet-class>org.apache.myfaces.trinidad.webapp.ResourceServlet</servlet-class>
> >     </servlet>
> >
> >     <servlet>
> >         <description>Resource Loader servlet für FMG Ressourcen.</description>
> >         <servlet-name>FMGResources</servlet-name>
> >         <servlet-class>fmg.lz06.jsfUtil.resource.ResourceServlet</servlet-class>
> >     </servlet>
> >
> >     <servlet>
> >         <servlet-name>PrintTable</servlet-name>
> >         <servlet-class>fmg.lf14.weasel.PrintTable</servlet-class>
> >     </servlet>
> >
> >     <!-- Faces Servlet Mappings -->
> >     <servlet-mapping>
> >         <servlet-name>faces</servlet-name>
> >         <url-pattern>/faces/*</url-pattern>
> >     </servlet-mapping>
> >
> >     <servlet-mapping>
> >         <servlet-name>resources</servlet-name>
> >         <url-pattern>/adf/*</url-pattern>
> >     </servlet-mapping>
> >
> >     <servlet-mapping>
> >         <servlet-name>PrintTable</servlet-name>
> >         <url-pattern>/PrintTable</url-pattern>
> >     </servlet-mapping>
> >
> >     <error-page>
> >         <error-code>403</error-code>
> >         <location>/faces/error403.xhtml</location>
> >     </error-page>
> >
> >     <error-page>
> >         <error-code>404</error-code>
> >         <location>/faces/error404.xhtml</location>
> >     </error-page>
> >
> >     <error-page>
> >         <error-code>500</error-code>
> >         <location>/error500.jsp</location>
> >     </error-page>
> >
> >     <error-page>
> >         <exception-type>java.lang.Throwable</exception-type>
> >         <location>/error500.jsp</location>
> >     </error-page>
> >
> >     <error-page>
> >         <exception-type>java.lang.RuntimeException</exception-type>
> >         <location>/faces/exception.xhtml</location>
> >     </error-page>
> >
> >     <!-- Container soll nach 30 Minuten für Timeout der Session sorgen. Dies
> >          ist nur ein zusätzliches Feature zum automatischen Refresh aus der
> >          layout.xhtml. -->
> >     <session-config>
> >         <session-timeout>30</session-timeout>
> >     </session-config>
> >
> >     <welcome-file-list>
> >         <welcome-file>index.html</welcome-file>
> >     </welcome-file-list>
> >
> >     <security-constraint>
> >         <display-name>Weasel Gesamt</display-name>
> >         <web-resource-collection>
> >             <web-resource-name>secureWeasel</web-resource-name>
> >             <description/>
> >             <url-pattern>/faces/pages/*</url-pattern>
> >         </web-resource-collection>
> >         <auth-constraint>
> >             <description/>
> >             <role-name>weasel</role-name>
> >         </auth-constraint>
> >     </security-constraint>
> >
> >     <security-constraint>
> >         <display-name>Weasel Detailansicht</display-name>
> >         <web-resource-collection>
> >             <web-resource-name>secureWeaselDetail</web-resource-name>
> >             <description/>
> >             <url-pattern>/faces/pages/tableSequenceDetail.xhtml</url-pattern>
> >         </web-resource-collection>
> >         <auth-constraint>
> >             <description/>
> >             <role-name>weasel-detail</role-name>
> >         </auth-constraint>
> >     </security-constraint>
> >
> >     <login-config>
> >         <auth-method>FORM</auth-method>
> >         <realm-name/>
> >         <form-login-config>
> >             <form-login-page>/faces/login.xhtml</form-login-page>
> >             <form-error-page>/faces/login.xhtml</form-error-page>
> >         </form-login-config>
> >     </login-config>
> >
> >     <security-role>
> >         <description>Rolle für prinzipiellen Zugriff auf Weasel.</description>
> >         <role-name>weasel</role-name>
> >     </security-role>
> >
> >     <security-role>
> >         <description>Rolle für Zugriff auf Detail-Sequenz.</description>
> >         <role-name>weasel-detail</role-name>
> >     </security-role>
> >
> >     <resource-ref>
> >         <res-ref-name>jdbc/myoracle</res-ref-name>
> >         <res-type>javax.sql.DataSource</res-type>
> >         <res-auth>Container</res-auth>
> >         <res-sharing-scope>Shareable</res-sharing-scope>
> >     </resource-ref>
> >
> > </web-app>
> > ---------------- SNIP -----------------
> >
> > Please let me know, if you need to see any other files.
> >
> > Peter
> >
> >
> >
> > -----Ursprüngliche Nachricht-----
> > Von: Adam Winer [mailto:awiner@gmail.com]
> > Gesendet: Freitag, 29. Juni 2007 18:03
> > An: MyFaces Discussion
> > Betreff: Re: [Trinidad] Causing Too many open files error?
> >
> >
> > These files should at most get locked once, and only at
> > startup, and the first GC should flush them...  Are you
> > really seeing repeated locks on these files?  Could
> > you show your web.xml?
> >
> > -- Adam
> >
> >
> >
> > On 6/29/07, Fleischer Peter <pe...@munich-airport.de> wrote:
> > >
> > >
> > > Hi Adam,
> > >
> > > yesterday Matthias sent me a 1.0.2-SNAPSHOT (tanks again!). I did some
> > > further testing with Tomcat and having the antiJarLocking option set to true
> > > in the the context.xml. With these settings I think I was able to track down
> > > the problem to a list of filenames as follows:
> > >
> > >
> > > java    12738 tomcat   65r  VREG         85,40    26783  270804
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/adf/styles/cache/fmg-desktop-1745436599-ie-6-cmp.css
> > > java    12738 tomcat   66r  VREG         85,40     2961 2719345
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/CharSets.js
> > > java    12738 tomcat   67r  VREG         85,40    18937 2719361
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/CoreFormat.js
> > > java    12738 tomcat   68r  VREG         85,40     3292 2719346
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateField.js
> > > java    12738 tomcat   69r  VREG         85,40      365 2719356
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateFieldFormat.js
> > > java    12738 tomcat   70r  VREG         85,40    12361 2719350
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateFormat.js
> > > java    12738 tomcat   71r  VREG         85,40    10945 2719358
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Locale.js
> > > java    12738 tomcat   72r  VREG         85,40    44505 2719364
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Core.js
> > > java    12738 tomcat   73r  VREG         85,40     4944 2719342
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Window.js
> > > java    12738 tomcat   74r  VREG         85,40     3267 2719355
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/TableProxy.js
> > > java    12738 tomcat   75r  VREG         85,40     1021 2719259
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Poll.js
> > > java    12738 tomcat   76r  VREG         85,40     2918 2719348
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorField.js
> > > java    12738 tomcat   77r  VREG         85,40      391 2719357
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorFieldFormat.js
> > > java    12738 tomcat   78r  VREG         85,40     5857 2719351
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorFormat.js
> > > java    12738 tomcat   79r  VREG         85,40    18382 2719353
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Shuttle.js
> > > java    12738 tomcat   80r  VREG         85,40     4648 2719363
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Page.js
> > > java    12738 tomcat   81r  VREG         85,40      639 2719362
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/StatusIndicator.js
> > > java    12738 tomcat   82r  VREG         85,40    10520 2791503
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/RequestQueue.js
> > > java    12738 tomcat   83r  VREG         85,40     2041 2791500
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/XMLRequest.js
> > > java    12738 tomcat   84r  VREG         85,40     1630 2791501
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/XMLRequestEvent.js
> > > java    12738 tomcat   85r  VREG         85,40     1594 2791502
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/IFrameXMLRequestEvent.js
> > > java    12738 tomcat   86r  VREG         85,40       86 2653467
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/images/t.gif
> > > java    12738 tomcat   87r  VREG         85,40       86 2653467
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/images/t.gif
> > > java    12738 tomcat   88r  VREG         85,40       86 2653467
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/images/t.gif
> > > java    12738 tomcat   90r  VREG         85,40    26783  270804
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/adf/styles/cache/fmg-desktop-1745436599-ie-6-cmp.css
> > > java    12738 tomcat   91r  VREG         85,40    26783  270804
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/adf/styles/cache/fmg-desktop-1745436599-ie-6-cmp.css
> > > java    12738 tomcat   92r  VREG         85,40     2961 2719345
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/CharSets.js
> > > java    12738 tomcat   93r  VREG         85,40    18937 2719361
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/CoreFormat.js
> > > java    12738 tomcat   94r  VREG         85,40     3292 2719346
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateField.js
> > > java    12738 tomcat   95r  VREG         85,40      365 2719356
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateFieldFormat.js
> > > java    12738 tomcat   96r  VREG         85,40    12361 2719350
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateFormat.js
> > > java    12738 tomcat   97r  VREG         85,40    10945 2719358
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Locale.js
> > > java    12738 tomcat   98r  VREG         85,40    44505 2719364
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Core.js
> > > java    12738 tomcat   99r  VREG         85,40     4944 2719342
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Window.js
> > > java    12738 tomcat  100r  VREG         85,40     3267 2719355
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/TableProxy.js
> > > java    12738 tomcat  101r  VREG         85,40     1021 2719259
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Poll.js
> > > java    12738 tomcat  102r  VREG         85,40     2918 2719348
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorField.js
> > > java    12738 tomcat  103r  VREG         85,40      391 2719357
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorFieldFormat.js
> > > java    12738 tomcat  104r  VREG         85,40     5857 2719351
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorFormat.js
> > > java    12738 tomcat  105r  VREG         85,40    18382 2719353
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Shuttle.js
> > > java    12738 tomcat  106r  VREG         85,40     4648 2719363
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Page.js
> > > java    12738 tomcat  107r  VREG         85,40      639 2719362
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/StatusIndicator.js
> > > java    12738 tomcat  108r  VREG         85,40    10520 2791503
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/RequestQueue.js
> > > java    12738 tomcat  109r  VREG         85,40     2041 2791500
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/XMLRequest.js
> > > java    12738 tomcat  110r  VREG         85,40     1630 2791501
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/XMLRequestEvent.js
> > > java    12738 tomcat  111r  VREG         85,40     1594 2791502
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/IFrameXMLRequestEvent.js
> > > java    12738 tomcat  112r  VREG         85,40     2961 2719345
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/CharSets.js
> > > java    12738 tomcat  113r  VREG         85,40    18937 2719361
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/CoreFormat.js
> > > java    12738 tomcat  114r  VREG         85,40     3292 2719346
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateField.js
> > > java    12738 tomcat  115r  VREG         85,40      365 2719356
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateFieldFormat.js
> > > java    12738 tomcat  116r  VREG         85,40    12361 2719350
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateFormat.js
> > > java    12738 tomcat  117r  VREG         85,40    10945 2719358
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Locale.js
> > > java    12738 tomcat  118r  VREG         85,40    44505 2719364
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Core.js
> > > java    12738 tomcat  119r  VREG         85,40     4944 2719342
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Window.js
> > > java    12738 tomcat  120r  VREG         85,40     3267 2719355
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/TableProxy.js
> > > java    12738 tomcat  121r  VREG         85,40     1021 2719259
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Poll.js
> > > java    12738 tomcat  122r  VREG         85,40     2918 2719348
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorField.js
> > > java    12738 tomcat  123r  VREG         85,40      391 2719357
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorFieldFormat.js
> > > java    12738 tomcat  124r  VREG         85,40     5857 2719351
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorFormat.js
> > > java    12738 tomcat  125r  VREG         85,40    18382 2719353
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Shuttle.js
> > > java    12738 tomcat  126r  VREG         85,40     4648 2719363
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Page.js
> > > java    12738 tomcat  127r  VREG         85,40      639 2719362
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/StatusIndicator.js
> > > java    12738 tomcat  128r  VREG         85,40    10520 2791503
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/RequestQueue.js
> > > java    12738 tomcat  129r  VREG         85,40     2041 2791500
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/XMLRequest.js
> > > java    12738 tomcat  130r  VREG         85,40     1630 2791501
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/XMLRequestEvent.js
> > > java    12738 tomcat  131r  VREG         85,40     1594 2791502
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/IFrameXMLRequestEvent.js
> > > java    12738 tomcat  133r  VREG         85,40      286 2653419
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/images/list-bullet.gif
> > > java    12738 tomcat  134r  VREG         85,40      417 2653475
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/images/siready.gif
> > > java    12738 tomcat  135r  VREG         85,40      781 2653474
> > > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/images/sibusy.gif
> > >
> > >
> > > This was tested with clearing the browser cache in before doing any requests
> > > to my application and navigating around a little bit. Repeating this test
> > > with a second browser (also clean cache) duplicated the count of open files.
> > >
> > > For now we manually do a GC in our application every 5 minutes to alleviate
> > > the problem but this is certainly only a quick&dirty solution.
> > >
> > > Peter
> > >
> > >
> > > -----Ursprüngliche Nachricht-----
> > > Von: Adam Winer [mailto:awiner@gmail.com]
> > > Gesendet: Donnerstag, 21. Juni 2007 23:29
> > >
> > > An: MyFaces Discussion
> > > Betreff: Re: [Trinidad] Causing Too many open files error?
> > >
> > >
> > > On 6/21/07, Simon Lessard <si...@gmail.com> wrote:
> > > > Hmmm, I assume this is used mainly to detect skin files' version?
> > >
> > >
> > >
> > > It's used in a bunch of places to detect modification - skin
> > > files, ResourceServlet, jsp modifications, etc.
> > > I've checked in a fix that should resolve this,
> > > but I'm not 100% sure.  I've mostly been looking at
> > > the calls to FileInputStream.finalize() - there were a
> > > lot coming in that had still-open FileDescriptors.
> > > I'd appreciate further testing.
> > >
> > >
> > > It'd be worthwhile to look at optimizing further to block
> > > any attempt to call getLastModified() on a JAR, but
> > > for now I'm hoping it'll be enough to close up all URLConnections.
> > > In a bit of googling, it'd seem that this has bitten a lot
> > > of developers.
> > >
> > >
> > > -- Adam
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > > Maybe we could create a kind of ResourceDescriptor file that would include
> > > two URLs, the real one and the container file's (the .jar URL for instance,
> > > but would be the same as the real URL most of the time). The getLastModified
> > > method of the ResourceDescriptor could then use that second URL for purpose
> > > of modification checks, theorically preventing the JVM from opening the JAR
> > > file.
> > > >
> > > >
> > > > Regards,
> > > >
> > > > ~ Simon
> > > >
> > > >
> > > >
> > > > On 6/21/07, Adam Winer < awiner@gmail.com> wrote:
> > > > > I think I've found the problem - Trinidad calls
> > > > > URLConnection.getLastModified() in a number
> > > > > of places.  If that's pointing at an URL from
> > > > > inside a JAR, this will implicitly open the
> > > > > JAR file, and not release the file until GC.
> > > > > Looking at solutions now.
> > > > >
> > > > >
> > > > > -- Adam
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > On 6/21/07, Fleischer Peter
> > > <pe...@munich-airport.de> wrote:
> > > > > >
> > > > > >
> > > > > > The problem is reproducable. After restarting tomcat and some requests
> > > to my application the jar file will again be opened multiple times. Every
> > > (initial?) request to a page increases the number. Eventually after some
> > > time the files are garbage collected.
> > > > > >
> > > > > > Peter
> > > > > >
> > > > > > -----Ursprüngliche Nachricht-----
> > > > > > Von: Scott O'Bryan [mailto:darkarena@gmail.com]
> > > > > > Gesendet: Donnerstag, 21. Juni 2007 00:29
> > > > > > An: MyFaces Discussion
> > > > > > Betreff: Re: [Trinidad] Causing Too many open files error?
> > > > > >
> > > > > >
> > > > > > I saw this as well using Oracle JDeveloper so I agree that I don't
> > > think this is a Tomcat issue.  I'm not sure what might be causing this
> > > though because I shut down my webserver and restarted it and everything has
> > > been working fine since.
> > > > > >
> > > > > > What happens when you restart tomcat?
> > > > > >
> > > > > > Scott
> > > > > >
> > > > > >
> > > > > > On 6/20/07, Fleischer Peter
> > > <peter.fleischer@munich-airport.de > wrote:
> > > > > > > Hello,
> > > > > > >
> > > > > > > we are developing a quite simple application based on MyFaces,
> > > Trinidad and Facelets. After deploying this application to a Tomcat 5.5.23
> > > and using the application for a while we are facing connection errors in
> > > Tomcat caused by too many open files.
> > > > > > >
> > > > > > > Checking the running Tomcat process with lsof (list open files) we
> > > discovered, that  <application>/WEB-INF/lib/trinidad-
> > > impl-1.0.1-incubating-SNAPSHOT.jar was open for about 300
> > > times. The number rises with every request. At some time eventually a
> > > garbage collection closes all these files.
> > > > > > >
> > > > > > > I don't think this is a Tomcat error, because this jar is the only
> > > jar file opened so many times. Perhaps some Trinidad code fails to close a
> > > file? Is this a known issue?
> > > > > > >
> > > > > > > Many thanks in advance.
> > > > > > >
> > > > > > > Peter Fleischer
> > > > > > >
> > > > > > >
> > > _____________________________________________________________
> > > > > > >
> > > > > > > Munich Airport International
> > > > > > > Flughafen München GmbH
> > > > > > > Peter Fleischer
> > > > > > > ITED Competence Center Application Development
> > > > > > > Support Division Information Technology
> > > > > > > P. O. Box  23 17 55
> > > > > > > 85326 München
> > > > > > > Phone: +49 89 975-3 24 30
> > > > > > > Fax: +49 89 975-3 24 06
> > > > > > > <mailto:peter.fleischer@munich-airport .de >
> > > > > > >
> > > > > > > Vorsitzender des Aufsichtsrats: - Chairman of the Supervisory Board:
> > > > > > > Staatsminister Prof. Dr. Kurt Faltlhauser
> > > > > > > Geschäftsführung: - Executive Board:
> > > > > > > Dr. Michael Kerkloh, Walter Vill und Peter Trautmann
> > > > > > > Handelsregister: - Commercial Register: RG München, HR-Nr. B 5448
> > > > > > > Sitz der Gesellschaft: - Registered Office: München
> > > > > > >
> > > _____________________________________________________________
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
>

Re: [Trinidad] Causing Too many open files error?

Posted by Adam Winer <aw...@gmail.com>.
Thanks - everything in web.xml seems as it should be.
Back to the code for me...

-- Adam



On 7/1/07, Fleischer Peter <pe...@munich-airport.de> wrote:
> Hi Adam,
>
> there are a lot of open files just after deployment of the application. That's right. And also these files are closed by first GC. But the files listed in my last post are really opened repeatedly and I see more and more of them with every open browser session. The .js files seem to be cached in the browser so the open files are not duplicated every time. But by doing a browser refresh I can increase the number of open files by about 30.
>
> This is using Tomcat 5.5.23 running with Sun's Java VM 1.5.0_08. This is my web.xml:
>
> -------------- SNIP --------------------
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
>
>     <description>Webapplication for Sequence Planning</description>
>     <display-name>Weasel</display-name>
>
>     <context-param>
>         <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
>         <param-value>true</param-value>
>     </context-param>
>
>     <context-param>
>         <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
>         <param-value>true</param-value>
>     </context-param>
>
>     <context-param>
>         <description>
>             Use client-side state saving. In Trinidad, it is an
>             optimized, token-based mechanism that is almost always a
>             better choice than the standard JSF server-side state saving.
>         </description>
>         <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
>         <param-value>client</param-value>
>     </context-param>
>
>     <context-param>
>         <description>
>             Konfiguration faces-config.xml in mehrere Dateien aufgeteilt.
>         </description>
>         <param-name>javax.faces.CONFIG_FILES</param-name>
>         <param-value>/WEB-INF/beans.xml,/WEB-INF/navigation.xml</param-value>
>     </context-param>
>
>     <context-param>
>         <description>
>             ADF Faces also supports an optimized strategy for caching some
>             view state at an application level, which significantly improves
>             scalability.  However, it makes it harder to develop (updates to
>             pages will not be noticed until the server is restarted), and in
>             some rare cases cannot be used for some pages (see ADF Faces
>             documentation for more information).
>         </description>
>         <param-name>org.apache.myfaces.trinidad.USE_APPLICATION_VIEW_CACHE</param-name>
>         <param-value>true</param-value>
>     </context-param>
>
>     <context-param>
>         <description>
>             If this parameter is enabled, ADF Faces will automatically
>             check the modification date of your JSPs, and discard saved
>             state when they change;  this makes development easier,
>             but adds overhead that should be avoided when your application
>             is deployed.
>         </description>
>         <param-name>org.apache.myfaces.trinidad.CHECK_FILE_MODIFICATION</param-name>
>         <param-value>false</param-value>
>     </context-param>
>
>     <context-param>
>         <description>
>             Enables Change Persistence at a session scope.  By default,
>             Change Persistence is entirely disabled. The ChangeManager is
>             an API, which can persist component modifications (like,
>             is a showDetail or tree expanded or collapsed). For providing
>             a custom Change Persistence implementation inherit from the
>             ADF Faces API's ChangeManager class. As the value you have
>             to use the fullqualified class name.
>         </description>
>         <param-name>org.apache.myfaces.trinidad.CHANGE_PERSISTENCE</param-name>
>         <param-value>session</param-value>
>     </context-param>
>
>     <context-param>
>         <description>
>             Über den AlternateViewHandler wird Facelets als ViewHandler in die
>             Verkettung der ViewHandler mit aufgenommen.
>         </description>
>         <param-name>org.apache.myfaces.trinidad.ALTERNATE_VIEW_HANDLER</param-name>
>         <param-value>com.sun.facelets.FaceletViewHandler</param-value>
>     </context-param>
>
>     <context-param>
>         <description>
>             Use Documents Saved as *.xhtml.
>         </description>
>         <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
>         <param-value>.xhtml</param-value>
>     </context-param>
>
>     <context-param>
>         <description>
>             Special Facelets Debug Output for Development.
>         </description>
>         <param-name>facelets.DEVELOPMENT</param-name>
>         <param-value>false</param-value>
>     </context-param>
>
>
>     <context-param>
>         <param-name>automaticDataPoller.timeoutSeconds</param-name>
>         <param-value>60</param-value>
>     </context-param>
>     <filter>
>         <filter-name>trinidad</filter-name>
>         <filter-class>org.apache.myfaces.trinidad.webapp.TrinidadFilter</filter-class>
>     </filter>
>
>     <filter-mapping>
>         <filter-name>trinidad</filter-name>
>         <servlet-name>faces</servlet-name>
>         <dispatcher>REQUEST</dispatcher>
>         <dispatcher>ERROR</dispatcher>
>     </filter-mapping>
>
>     <!-- Faces Servlet -->
>     <listener>
>         <description>Regelmäßige DB-Selects.</description>
>         <listener-class>fmg.lf14.weasel.AutomaticDataPoller</listener-class>
>     </listener>
>     <servlet>
>         <description>Faces Servlet</description>
>         <servlet-name>faces</servlet-name>
>         <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
>     </servlet>
>
>     <!-- resource loader servlet -->
>     <servlet>
>         <description>Resource Loader servlet für Trinidad.</description>
>         <servlet-name>resources</servlet-name>
>         <servlet-class>org.apache.myfaces.trinidad.webapp.ResourceServlet</servlet-class>
>     </servlet>
>
>     <servlet>
>         <description>Resource Loader servlet für FMG Ressourcen.</description>
>         <servlet-name>FMGResources</servlet-name>
>         <servlet-class>fmg.lz06.jsfUtil.resource.ResourceServlet</servlet-class>
>     </servlet>
>
>     <servlet>
>         <servlet-name>PrintTable</servlet-name>
>         <servlet-class>fmg.lf14.weasel.PrintTable</servlet-class>
>     </servlet>
>
>     <!-- Faces Servlet Mappings -->
>     <servlet-mapping>
>         <servlet-name>faces</servlet-name>
>         <url-pattern>/faces/*</url-pattern>
>     </servlet-mapping>
>
>     <servlet-mapping>
>         <servlet-name>resources</servlet-name>
>         <url-pattern>/adf/*</url-pattern>
>     </servlet-mapping>
>
>     <servlet-mapping>
>         <servlet-name>PrintTable</servlet-name>
>         <url-pattern>/PrintTable</url-pattern>
>     </servlet-mapping>
>
>     <error-page>
>         <error-code>403</error-code>
>         <location>/faces/error403.xhtml</location>
>     </error-page>
>
>     <error-page>
>         <error-code>404</error-code>
>         <location>/faces/error404.xhtml</location>
>     </error-page>
>
>     <error-page>
>         <error-code>500</error-code>
>         <location>/error500.jsp</location>
>     </error-page>
>
>     <error-page>
>         <exception-type>java.lang.Throwable</exception-type>
>         <location>/error500.jsp</location>
>     </error-page>
>
>     <error-page>
>         <exception-type>java.lang.RuntimeException</exception-type>
>         <location>/faces/exception.xhtml</location>
>     </error-page>
>
>     <!-- Container soll nach 30 Minuten für Timeout der Session sorgen. Dies
>          ist nur ein zusätzliches Feature zum automatischen Refresh aus der
>          layout.xhtml. -->
>     <session-config>
>         <session-timeout>30</session-timeout>
>     </session-config>
>
>     <welcome-file-list>
>         <welcome-file>index.html</welcome-file>
>     </welcome-file-list>
>
>     <security-constraint>
>         <display-name>Weasel Gesamt</display-name>
>         <web-resource-collection>
>             <web-resource-name>secureWeasel</web-resource-name>
>             <description/>
>             <url-pattern>/faces/pages/*</url-pattern>
>         </web-resource-collection>
>         <auth-constraint>
>             <description/>
>             <role-name>weasel</role-name>
>         </auth-constraint>
>     </security-constraint>
>
>     <security-constraint>
>         <display-name>Weasel Detailansicht</display-name>
>         <web-resource-collection>
>             <web-resource-name>secureWeaselDetail</web-resource-name>
>             <description/>
>             <url-pattern>/faces/pages/tableSequenceDetail.xhtml</url-pattern>
>         </web-resource-collection>
>         <auth-constraint>
>             <description/>
>             <role-name>weasel-detail</role-name>
>         </auth-constraint>
>     </security-constraint>
>
>     <login-config>
>         <auth-method>FORM</auth-method>
>         <realm-name/>
>         <form-login-config>
>             <form-login-page>/faces/login.xhtml</form-login-page>
>             <form-error-page>/faces/login.xhtml</form-error-page>
>         </form-login-config>
>     </login-config>
>
>     <security-role>
>         <description>Rolle für prinzipiellen Zugriff auf Weasel.</description>
>         <role-name>weasel</role-name>
>     </security-role>
>
>     <security-role>
>         <description>Rolle für Zugriff auf Detail-Sequenz.</description>
>         <role-name>weasel-detail</role-name>
>     </security-role>
>
>     <resource-ref>
>         <res-ref-name>jdbc/myoracle</res-ref-name>
>         <res-type>javax.sql.DataSource</res-type>
>         <res-auth>Container</res-auth>
>         <res-sharing-scope>Shareable</res-sharing-scope>
>     </resource-ref>
>
> </web-app>
> ---------------- SNIP -----------------
>
> Please let me know, if you need to see any other files.
>
> Peter
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: Adam Winer [mailto:awiner@gmail.com]
> Gesendet: Freitag, 29. Juni 2007 18:03
> An: MyFaces Discussion
> Betreff: Re: [Trinidad] Causing Too many open files error?
>
>
> These files should at most get locked once, and only at
> startup, and the first GC should flush them...  Are you
> really seeing repeated locks on these files?  Could
> you show your web.xml?
>
> -- Adam
>
>
>
> On 6/29/07, Fleischer Peter <pe...@munich-airport.de> wrote:
> >
> >
> > Hi Adam,
> >
> > yesterday Matthias sent me a 1.0.2-SNAPSHOT (tanks again!). I did some
> > further testing with Tomcat and having the antiJarLocking option set to true
> > in the the context.xml. With these settings I think I was able to track down
> > the problem to a list of filenames as follows:
> >
> >
> > java    12738 tomcat   65r  VREG         85,40    26783  270804
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/adf/styles/cache/fmg-desktop-1745436599-ie-6-cmp.css
> > java    12738 tomcat   66r  VREG         85,40     2961 2719345
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/CharSets.js
> > java    12738 tomcat   67r  VREG         85,40    18937 2719361
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/CoreFormat.js
> > java    12738 tomcat   68r  VREG         85,40     3292 2719346
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateField.js
> > java    12738 tomcat   69r  VREG         85,40      365 2719356
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateFieldFormat.js
> > java    12738 tomcat   70r  VREG         85,40    12361 2719350
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateFormat.js
> > java    12738 tomcat   71r  VREG         85,40    10945 2719358
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Locale.js
> > java    12738 tomcat   72r  VREG         85,40    44505 2719364
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Core.js
> > java    12738 tomcat   73r  VREG         85,40     4944 2719342
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Window.js
> > java    12738 tomcat   74r  VREG         85,40     3267 2719355
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/TableProxy.js
> > java    12738 tomcat   75r  VREG         85,40     1021 2719259
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Poll.js
> > java    12738 tomcat   76r  VREG         85,40     2918 2719348
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorField.js
> > java    12738 tomcat   77r  VREG         85,40      391 2719357
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorFieldFormat.js
> > java    12738 tomcat   78r  VREG         85,40     5857 2719351
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorFormat.js
> > java    12738 tomcat   79r  VREG         85,40    18382 2719353
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Shuttle.js
> > java    12738 tomcat   80r  VREG         85,40     4648 2719363
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Page.js
> > java    12738 tomcat   81r  VREG         85,40      639 2719362
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/StatusIndicator.js
> > java    12738 tomcat   82r  VREG         85,40    10520 2791503
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/RequestQueue.js
> > java    12738 tomcat   83r  VREG         85,40     2041 2791500
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/XMLRequest.js
> > java    12738 tomcat   84r  VREG         85,40     1630 2791501
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/XMLRequestEvent.js
> > java    12738 tomcat   85r  VREG         85,40     1594 2791502
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/IFrameXMLRequestEvent.js
> > java    12738 tomcat   86r  VREG         85,40       86 2653467
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/images/t.gif
> > java    12738 tomcat   87r  VREG         85,40       86 2653467
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/images/t.gif
> > java    12738 tomcat   88r  VREG         85,40       86 2653467
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/images/t.gif
> > java    12738 tomcat   90r  VREG         85,40    26783  270804
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/adf/styles/cache/fmg-desktop-1745436599-ie-6-cmp.css
> > java    12738 tomcat   91r  VREG         85,40    26783  270804
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/adf/styles/cache/fmg-desktop-1745436599-ie-6-cmp.css
> > java    12738 tomcat   92r  VREG         85,40     2961 2719345
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/CharSets.js
> > java    12738 tomcat   93r  VREG         85,40    18937 2719361
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/CoreFormat.js
> > java    12738 tomcat   94r  VREG         85,40     3292 2719346
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateField.js
> > java    12738 tomcat   95r  VREG         85,40      365 2719356
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateFieldFormat.js
> > java    12738 tomcat   96r  VREG         85,40    12361 2719350
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateFormat.js
> > java    12738 tomcat   97r  VREG         85,40    10945 2719358
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Locale.js
> > java    12738 tomcat   98r  VREG         85,40    44505 2719364
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Core.js
> > java    12738 tomcat   99r  VREG         85,40     4944 2719342
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Window.js
> > java    12738 tomcat  100r  VREG         85,40     3267 2719355
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/TableProxy.js
> > java    12738 tomcat  101r  VREG         85,40     1021 2719259
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Poll.js
> > java    12738 tomcat  102r  VREG         85,40     2918 2719348
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorField.js
> > java    12738 tomcat  103r  VREG         85,40      391 2719357
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorFieldFormat.js
> > java    12738 tomcat  104r  VREG         85,40     5857 2719351
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorFormat.js
> > java    12738 tomcat  105r  VREG         85,40    18382 2719353
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Shuttle.js
> > java    12738 tomcat  106r  VREG         85,40     4648 2719363
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Page.js
> > java    12738 tomcat  107r  VREG         85,40      639 2719362
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/StatusIndicator.js
> > java    12738 tomcat  108r  VREG         85,40    10520 2791503
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/RequestQueue.js
> > java    12738 tomcat  109r  VREG         85,40     2041 2791500
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/XMLRequest.js
> > java    12738 tomcat  110r  VREG         85,40     1630 2791501
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/XMLRequestEvent.js
> > java    12738 tomcat  111r  VREG         85,40     1594 2791502
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/IFrameXMLRequestEvent.js
> > java    12738 tomcat  112r  VREG         85,40     2961 2719345
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/CharSets.js
> > java    12738 tomcat  113r  VREG         85,40    18937 2719361
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/CoreFormat.js
> > java    12738 tomcat  114r  VREG         85,40     3292 2719346
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateField.js
> > java    12738 tomcat  115r  VREG         85,40      365 2719356
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateFieldFormat.js
> > java    12738 tomcat  116r  VREG         85,40    12361 2719350
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateFormat.js
> > java    12738 tomcat  117r  VREG         85,40    10945 2719358
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Locale.js
> > java    12738 tomcat  118r  VREG         85,40    44505 2719364
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Core.js
> > java    12738 tomcat  119r  VREG         85,40     4944 2719342
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Window.js
> > java    12738 tomcat  120r  VREG         85,40     3267 2719355
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/TableProxy.js
> > java    12738 tomcat  121r  VREG         85,40     1021 2719259
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Poll.js
> > java    12738 tomcat  122r  VREG         85,40     2918 2719348
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorField.js
> > java    12738 tomcat  123r  VREG         85,40      391 2719357
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorFieldFormat.js
> > java    12738 tomcat  124r  VREG         85,40     5857 2719351
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorFormat.js
> > java    12738 tomcat  125r  VREG         85,40    18382 2719353
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Shuttle.js
> > java    12738 tomcat  126r  VREG         85,40     4648 2719363
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Page.js
> > java    12738 tomcat  127r  VREG         85,40      639 2719362
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/StatusIndicator.js
> > java    12738 tomcat  128r  VREG         85,40    10520 2791503
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/RequestQueue.js
> > java    12738 tomcat  129r  VREG         85,40     2041 2791500
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/XMLRequest.js
> > java    12738 tomcat  130r  VREG         85,40     1630 2791501
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/XMLRequestEvent.js
> > java    12738 tomcat  131r  VREG         85,40     1594 2791502
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/IFrameXMLRequestEvent.js
> > java    12738 tomcat  133r  VREG         85,40      286 2653419
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/images/list-bullet.gif
> > java    12738 tomcat  134r  VREG         85,40      417 2653475
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/images/siready.gif
> > java    12738 tomcat  135r  VREG         85,40      781 2653474
> > /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/images/sibusy.gif
> >
> >
> > This was tested with clearing the browser cache in before doing any requests
> > to my application and navigating around a little bit. Repeating this test
> > with a second browser (also clean cache) duplicated the count of open files.
> >
> > For now we manually do a GC in our application every 5 minutes to alleviate
> > the problem but this is certainly only a quick&dirty solution.
> >
> > Peter
> >
> >
> > -----Ursprüngliche Nachricht-----
> > Von: Adam Winer [mailto:awiner@gmail.com]
> > Gesendet: Donnerstag, 21. Juni 2007 23:29
> >
> > An: MyFaces Discussion
> > Betreff: Re: [Trinidad] Causing Too many open files error?
> >
> >
> > On 6/21/07, Simon Lessard <si...@gmail.com> wrote:
> > > Hmmm, I assume this is used mainly to detect skin files' version?
> >
> >
> >
> > It's used in a bunch of places to detect modification - skin
> > files, ResourceServlet, jsp modifications, etc.
> > I've checked in a fix that should resolve this,
> > but I'm not 100% sure.  I've mostly been looking at
> > the calls to FileInputStream.finalize() - there were a
> > lot coming in that had still-open FileDescriptors.
> > I'd appreciate further testing.
> >
> >
> > It'd be worthwhile to look at optimizing further to block
> > any attempt to call getLastModified() on a JAR, but
> > for now I'm hoping it'll be enough to close up all URLConnections.
> > In a bit of googling, it'd seem that this has bitten a lot
> > of developers.
> >
> >
> > -- Adam
> >
> >
> >
> >
> >
> >
> >
> >
> > > Maybe we could create a kind of ResourceDescriptor file that would include
> > two URLs, the real one and the container file's (the .jar URL for instance,
> > but would be the same as the real URL most of the time). The getLastModified
> > method of the ResourceDescriptor could then use that second URL for purpose
> > of modification checks, theorically preventing the JVM from opening the JAR
> > file.
> > >
> > >
> > > Regards,
> > >
> > > ~ Simon
> > >
> > >
> > >
> > > On 6/21/07, Adam Winer < awiner@gmail.com> wrote:
> > > > I think I've found the problem - Trinidad calls
> > > > URLConnection.getLastModified() in a number
> > > > of places.  If that's pointing at an URL from
> > > > inside a JAR, this will implicitly open the
> > > > JAR file, and not release the file until GC.
> > > > Looking at solutions now.
> > > >
> > > >
> > > > -- Adam
> > > >
> > > >
> > > >
> > > >
> > > > On 6/21/07, Fleischer Peter
> > <pe...@munich-airport.de> wrote:
> > > > >
> > > > >
> > > > > The problem is reproducable. After restarting tomcat and some requests
> > to my application the jar file will again be opened multiple times. Every
> > (initial?) request to a page increases the number. Eventually after some
> > time the files are garbage collected.
> > > > >
> > > > > Peter
> > > > >
> > > > > -----Ursprüngliche Nachricht-----
> > > > > Von: Scott O'Bryan [mailto:darkarena@gmail.com]
> > > > > Gesendet: Donnerstag, 21. Juni 2007 00:29
> > > > > An: MyFaces Discussion
> > > > > Betreff: Re: [Trinidad] Causing Too many open files error?
> > > > >
> > > > >
> > > > > I saw this as well using Oracle JDeveloper so I agree that I don't
> > think this is a Tomcat issue.  I'm not sure what might be causing this
> > though because I shut down my webserver and restarted it and everything has
> > been working fine since.
> > > > >
> > > > > What happens when you restart tomcat?
> > > > >
> > > > > Scott
> > > > >
> > > > >
> > > > > On 6/20/07, Fleischer Peter
> > <peter.fleischer@munich-airport.de > wrote:
> > > > > > Hello,
> > > > > >
> > > > > > we are developing a quite simple application based on MyFaces,
> > Trinidad and Facelets. After deploying this application to a Tomcat 5.5.23
> > and using the application for a while we are facing connection errors in
> > Tomcat caused by too many open files.
> > > > > >
> > > > > > Checking the running Tomcat process with lsof (list open files) we
> > discovered, that  <application>/WEB-INF/lib/trinidad-
> > impl-1.0.1-incubating-SNAPSHOT.jar was open for about 300
> > times. The number rises with every request. At some time eventually a
> > garbage collection closes all these files.
> > > > > >
> > > > > > I don't think this is a Tomcat error, because this jar is the only
> > jar file opened so many times. Perhaps some Trinidad code fails to close a
> > file? Is this a known issue?
> > > > > >
> > > > > > Many thanks in advance.
> > > > > >
> > > > > > Peter Fleischer
> > > > > >
> > > > > >
> > _____________________________________________________________
> > > > > >
> > > > > > Munich Airport International
> > > > > > Flughafen München GmbH
> > > > > > Peter Fleischer
> > > > > > ITED Competence Center Application Development
> > > > > > Support Division Information Technology
> > > > > > P. O. Box  23 17 55
> > > > > > 85326 München
> > > > > > Phone: +49 89 975-3 24 30
> > > > > > Fax: +49 89 975-3 24 06
> > > > > > <mailto:peter.fleischer@munich-airport .de >
> > > > > >
> > > > > > Vorsitzender des Aufsichtsrats: - Chairman of the Supervisory Board:
> > > > > > Staatsminister Prof. Dr. Kurt Faltlhauser
> > > > > > Geschäftsführung: - Executive Board:
> > > > > > Dr. Michael Kerkloh, Walter Vill und Peter Trautmann
> > > > > > Handelsregister: - Commercial Register: RG München, HR-Nr. B 5448
> > > > > > Sitz der Gesellschaft: - Registered Office: München
> > > > > >
> > _____________________________________________________________
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>

AW: [Trinidad] Causing Too many open files error?

Posted by Fleischer Peter <pe...@munich-airport.de>.
Hi Adam,

there are a lot of open files just after deployment of the application. That's right. And also these files are closed by first GC. But the files listed in my last post are really opened repeatedly and I see more and more of them with every open browser session. The .js files seem to be cached in the browser so the open files are not duplicated every time. But by doing a browser refresh I can increase the number of open files by about 30.

This is using Tomcat 5.5.23 running with Sun's Java VM 1.5.0_08. This is my web.xml:

-------------- SNIP --------------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
       
    <description>Webapplication for Sequence Planning</description>
    <display-name>Weasel</display-name>
    
    <context-param>
        <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
        <param-value>true</param-value>
    </context-param>
    
    <context-param>
        <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
        <param-value>true</param-value>
    </context-param>    
    
    <context-param>
        <description>
            Use client-side state saving. In Trinidad, it is an
            optimized, token-based mechanism that is almost always a
            better choice than the standard JSF server-side state saving.
        </description>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>client</param-value>
    </context-param>

    <context-param>
        <description>
            Konfiguration faces-config.xml in mehrere Dateien aufgeteilt.
        </description>
        <param-name>javax.faces.CONFIG_FILES</param-name>
        <param-value>/WEB-INF/beans.xml,/WEB-INF/navigation.xml</param-value>
    </context-param>
    
    <context-param>
        <description>
            ADF Faces also supports an optimized strategy for caching some
            view state at an application level, which significantly improves
            scalability.  However, it makes it harder to develop (updates to
            pages will not be noticed until the server is restarted), and in
            some rare cases cannot be used for some pages (see ADF Faces
            documentation for more information).
        </description>
        <param-name>org.apache.myfaces.trinidad.USE_APPLICATION_VIEW_CACHE</param-name>
        <param-value>true</param-value>
    </context-param>

    <context-param>
        <description>
            If this parameter is enabled, ADF Faces will automatically
            check the modification date of your JSPs, and discard saved
            state when they change;  this makes development easier,
            but adds overhead that should be avoided when your application
            is deployed.
        </description>   
        <param-name>org.apache.myfaces.trinidad.CHECK_FILE_MODIFICATION</param-name>
        <param-value>false</param-value>
    </context-param>

    <context-param>
        <description>        
            Enables Change Persistence at a session scope.  By default,
            Change Persistence is entirely disabled. The ChangeManager is
            an API, which can persist component modifications (like,
            is a showDetail or tree expanded or collapsed). For providing
            a custom Change Persistence implementation inherit from the 
            ADF Faces API's ChangeManager class. As the value you have 
            to use the fullqualified class name.
        </description>              
        <param-name>org.apache.myfaces.trinidad.CHANGE_PERSISTENCE</param-name>
        <param-value>session</param-value>
    </context-param>
    
    <context-param>
        <description>
            Über den AlternateViewHandler wird Facelets als ViewHandler in die
            Verkettung der ViewHandler mit aufgenommen.
        </description>
        <param-name>org.apache.myfaces.trinidad.ALTERNATE_VIEW_HANDLER</param-name>
        <param-value>com.sun.facelets.FaceletViewHandler</param-value>
    </context-param>
    
    <context-param>
        <description>
            Use Documents Saved as *.xhtml.
        </description>
        <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
        <param-value>.xhtml</param-value>
    </context-param>
    
    <context-param>
        <description>
            Special Facelets Debug Output for Development.
        </description>
        <param-name>facelets.DEVELOPMENT</param-name>
        <param-value>false</param-value>
    </context-param>

    
    <context-param>
        <param-name>automaticDataPoller.timeoutSeconds</param-name>
        <param-value>60</param-value>
    </context-param>
    <filter>
        <filter-name>trinidad</filter-name>
        <filter-class>org.apache.myfaces.trinidad.webapp.TrinidadFilter</filter-class>
    </filter>

    <filter-mapping>
        <filter-name>trinidad</filter-name>
        <servlet-name>faces</servlet-name>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>ERROR</dispatcher>
    </filter-mapping>
    
    <!-- Faces Servlet -->
    <listener>
        <description>Regelmäßige DB-Selects.</description>
        <listener-class>fmg.lf14.weasel.AutomaticDataPoller</listener-class>
    </listener>
    <servlet>
        <description>Faces Servlet</description>
        <servlet-name>faces</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    </servlet>
  
    <!-- resource loader servlet -->
    <servlet>
        <description>Resource Loader servlet für Trinidad.</description>
        <servlet-name>resources</servlet-name>
        <servlet-class>org.apache.myfaces.trinidad.webapp.ResourceServlet</servlet-class>
    </servlet>
    
    <servlet>
        <description>Resource Loader servlet für FMG Ressourcen.</description>        
        <servlet-name>FMGResources</servlet-name>
        <servlet-class>fmg.lz06.jsfUtil.resource.ResourceServlet</servlet-class>
    </servlet>
    
    <servlet>
        <servlet-name>PrintTable</servlet-name>
        <servlet-class>fmg.lf14.weasel.PrintTable</servlet-class>
    </servlet>

    <!-- Faces Servlet Mappings -->
    <servlet-mapping>
        <servlet-name>faces</servlet-name>
        <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
  
    <servlet-mapping>
        <servlet-name>resources</servlet-name>
        <url-pattern>/adf/*</url-pattern>
    </servlet-mapping>
    
    <servlet-mapping>
        <servlet-name>PrintTable</servlet-name>
        <url-pattern>/PrintTable</url-pattern>
    </servlet-mapping>

    <error-page> 
        <error-code>403</error-code> 
        <location>/faces/error403.xhtml</location>
    </error-page>
    
    <error-page> 
        <error-code>404</error-code> 
        <location>/faces/error404.xhtml</location>
    </error-page>
    
    <error-page> 
        <error-code>500</error-code> 
        <location>/error500.jsp</location>
    </error-page>
    
    <error-page> 
        <exception-type>java.lang.Throwable</exception-type> 
        <location>/error500.jsp</location>
    </error-page>   

    <error-page> 
        <exception-type>java.lang.RuntimeException</exception-type> 
        <location>/faces/exception.xhtml</location>
    </error-page>    

    <!-- Container soll nach 30 Minuten für Timeout der Session sorgen. Dies
         ist nur ein zusätzliches Feature zum automatischen Refresh aus der
         layout.xhtml. -->
    <session-config>        
        <session-timeout>30</session-timeout>
    </session-config>
    
    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
    </welcome-file-list>
    
    <security-constraint>
        <display-name>Weasel Gesamt</display-name>
        <web-resource-collection>
            <web-resource-name>secureWeasel</web-resource-name>
            <description/>
            <url-pattern>/faces/pages/*</url-pattern>
        </web-resource-collection>
        <auth-constraint>
            <description/>
            <role-name>weasel</role-name>
        </auth-constraint>
    </security-constraint>
    
    <security-constraint>
        <display-name>Weasel Detailansicht</display-name>
        <web-resource-collection>
            <web-resource-name>secureWeaselDetail</web-resource-name>
            <description/>
            <url-pattern>/faces/pages/tableSequenceDetail.xhtml</url-pattern>
        </web-resource-collection>
        <auth-constraint>
            <description/>
            <role-name>weasel-detail</role-name>
        </auth-constraint>
    </security-constraint>
    
    <login-config>
        <auth-method>FORM</auth-method>
        <realm-name/>
        <form-login-config>
            <form-login-page>/faces/login.xhtml</form-login-page>
            <form-error-page>/faces/login.xhtml</form-error-page>            
        </form-login-config>
    </login-config>
    
    <security-role>
        <description>Rolle für prinzipiellen Zugriff auf Weasel.</description>
        <role-name>weasel</role-name>
    </security-role>
    
    <security-role>
        <description>Rolle für Zugriff auf Detail-Sequenz.</description>
        <role-name>weasel-detail</role-name>
    </security-role>    
    
    <resource-ref>
        <res-ref-name>jdbc/myoracle</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
        <res-sharing-scope>Shareable</res-sharing-scope>
    </resource-ref>
    
</web-app>
---------------- SNIP -----------------

Please let me know, if you need to see any other files.

Peter



-----Ursprüngliche Nachricht-----
Von: Adam Winer [mailto:awiner@gmail.com]
Gesendet: Freitag, 29. Juni 2007 18:03
An: MyFaces Discussion
Betreff: Re: [Trinidad] Causing Too many open files error?


These files should at most get locked once, and only at
startup, and the first GC should flush them...  Are you
really seeing repeated locks on these files?  Could
you show your web.xml?

-- Adam



On 6/29/07, Fleischer Peter <pe...@munich-airport.de> wrote:
>
>
> Hi Adam,
>
> yesterday Matthias sent me a 1.0.2-SNAPSHOT (tanks again!). I did some
> further testing with Tomcat and having the antiJarLocking option set to true
> in the the context.xml. With these settings I think I was able to track down
> the problem to a list of filenames as follows:
>
>
> java    12738 tomcat   65r  VREG         85,40    26783  270804
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/adf/styles/cache/fmg-desktop-1745436599-ie-6-cmp.css
> java    12738 tomcat   66r  VREG         85,40     2961 2719345
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/CharSets.js
> java    12738 tomcat   67r  VREG         85,40    18937 2719361
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/CoreFormat.js
> java    12738 tomcat   68r  VREG         85,40     3292 2719346
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateField.js
> java    12738 tomcat   69r  VREG         85,40      365 2719356
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateFieldFormat.js
> java    12738 tomcat   70r  VREG         85,40    12361 2719350
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateFormat.js
> java    12738 tomcat   71r  VREG         85,40    10945 2719358
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Locale.js
> java    12738 tomcat   72r  VREG         85,40    44505 2719364
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Core.js
> java    12738 tomcat   73r  VREG         85,40     4944 2719342
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Window.js
> java    12738 tomcat   74r  VREG         85,40     3267 2719355
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/TableProxy.js
> java    12738 tomcat   75r  VREG         85,40     1021 2719259
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Poll.js
> java    12738 tomcat   76r  VREG         85,40     2918 2719348
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorField.js
> java    12738 tomcat   77r  VREG         85,40      391 2719357
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorFieldFormat.js
> java    12738 tomcat   78r  VREG         85,40     5857 2719351
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorFormat.js
> java    12738 tomcat   79r  VREG         85,40    18382 2719353
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Shuttle.js
> java    12738 tomcat   80r  VREG         85,40     4648 2719363
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Page.js
> java    12738 tomcat   81r  VREG         85,40      639 2719362
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/StatusIndicator.js
> java    12738 tomcat   82r  VREG         85,40    10520 2791503
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/RequestQueue.js
> java    12738 tomcat   83r  VREG         85,40     2041 2791500
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/XMLRequest.js
> java    12738 tomcat   84r  VREG         85,40     1630 2791501
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/XMLRequestEvent.js
> java    12738 tomcat   85r  VREG         85,40     1594 2791502
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/IFrameXMLRequestEvent.js
> java    12738 tomcat   86r  VREG         85,40       86 2653467
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/images/t.gif
> java    12738 tomcat   87r  VREG         85,40       86 2653467
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/images/t.gif
> java    12738 tomcat   88r  VREG         85,40       86 2653467
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/images/t.gif
> java    12738 tomcat   90r  VREG         85,40    26783  270804
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/adf/styles/cache/fmg-desktop-1745436599-ie-6-cmp.css
> java    12738 tomcat   91r  VREG         85,40    26783  270804
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/adf/styles/cache/fmg-desktop-1745436599-ie-6-cmp.css
> java    12738 tomcat   92r  VREG         85,40     2961 2719345
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/CharSets.js
> java    12738 tomcat   93r  VREG         85,40    18937 2719361
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/CoreFormat.js
> java    12738 tomcat   94r  VREG         85,40     3292 2719346
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateField.js
> java    12738 tomcat   95r  VREG         85,40      365 2719356
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateFieldFormat.js
> java    12738 tomcat   96r  VREG         85,40    12361 2719350
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateFormat.js
> java    12738 tomcat   97r  VREG         85,40    10945 2719358
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Locale.js
> java    12738 tomcat   98r  VREG         85,40    44505 2719364
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Core.js
> java    12738 tomcat   99r  VREG         85,40     4944 2719342
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Window.js
> java    12738 tomcat  100r  VREG         85,40     3267 2719355
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/TableProxy.js
> java    12738 tomcat  101r  VREG         85,40     1021 2719259
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Poll.js
> java    12738 tomcat  102r  VREG         85,40     2918 2719348
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorField.js
> java    12738 tomcat  103r  VREG         85,40      391 2719357
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorFieldFormat.js
> java    12738 tomcat  104r  VREG         85,40     5857 2719351
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorFormat.js
> java    12738 tomcat  105r  VREG         85,40    18382 2719353
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Shuttle.js
> java    12738 tomcat  106r  VREG         85,40     4648 2719363
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Page.js
> java    12738 tomcat  107r  VREG         85,40      639 2719362
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/StatusIndicator.js
> java    12738 tomcat  108r  VREG         85,40    10520 2791503
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/RequestQueue.js
> java    12738 tomcat  109r  VREG         85,40     2041 2791500
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/XMLRequest.js
> java    12738 tomcat  110r  VREG         85,40     1630 2791501
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/XMLRequestEvent.js
> java    12738 tomcat  111r  VREG         85,40     1594 2791502
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/IFrameXMLRequestEvent.js
> java    12738 tomcat  112r  VREG         85,40     2961 2719345
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/CharSets.js
> java    12738 tomcat  113r  VREG         85,40    18937 2719361
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/CoreFormat.js
> java    12738 tomcat  114r  VREG         85,40     3292 2719346
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateField.js
> java    12738 tomcat  115r  VREG         85,40      365 2719356
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateFieldFormat.js
> java    12738 tomcat  116r  VREG         85,40    12361 2719350
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateFormat.js
> java    12738 tomcat  117r  VREG         85,40    10945 2719358
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Locale.js
> java    12738 tomcat  118r  VREG         85,40    44505 2719364
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Core.js
> java    12738 tomcat  119r  VREG         85,40     4944 2719342
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Window.js
> java    12738 tomcat  120r  VREG         85,40     3267 2719355
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/TableProxy.js
> java    12738 tomcat  121r  VREG         85,40     1021 2719259
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Poll.js
> java    12738 tomcat  122r  VREG         85,40     2918 2719348
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorField.js
> java    12738 tomcat  123r  VREG         85,40      391 2719357
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorFieldFormat.js
> java    12738 tomcat  124r  VREG         85,40     5857 2719351
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorFormat.js
> java    12738 tomcat  125r  VREG         85,40    18382 2719353
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Shuttle.js
> java    12738 tomcat  126r  VREG         85,40     4648 2719363
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Page.js
> java    12738 tomcat  127r  VREG         85,40      639 2719362
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/StatusIndicator.js
> java    12738 tomcat  128r  VREG         85,40    10520 2791503
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/RequestQueue.js
> java    12738 tomcat  129r  VREG         85,40     2041 2791500
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/XMLRequest.js
> java    12738 tomcat  130r  VREG         85,40     1630 2791501
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/XMLRequestEvent.js
> java    12738 tomcat  131r  VREG         85,40     1594 2791502
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/IFrameXMLRequestEvent.js
> java    12738 tomcat  133r  VREG         85,40      286 2653419
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/images/list-bullet.gif
> java    12738 tomcat  134r  VREG         85,40      417 2653475
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/images/siready.gif
> java    12738 tomcat  135r  VREG         85,40      781 2653474
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/images/sibusy.gif
>
>
> This was tested with clearing the browser cache in before doing any requests
> to my application and navigating around a little bit. Repeating this test
> with a second browser (also clean cache) duplicated the count of open files.
>
> For now we manually do a GC in our application every 5 minutes to alleviate
> the problem but this is certainly only a quick&dirty solution.
>
> Peter
>
>
> -----Ursprüngliche Nachricht-----
> Von: Adam Winer [mailto:awiner@gmail.com]
> Gesendet: Donnerstag, 21. Juni 2007 23:29
>
> An: MyFaces Discussion
> Betreff: Re: [Trinidad] Causing Too many open files error?
>
>
> On 6/21/07, Simon Lessard <si...@gmail.com> wrote:
> > Hmmm, I assume this is used mainly to detect skin files' version?
>
>
>
> It's used in a bunch of places to detect modification - skin
> files, ResourceServlet, jsp modifications, etc.
> I've checked in a fix that should resolve this,
> but I'm not 100% sure.  I've mostly been looking at
> the calls to FileInputStream.finalize() - there were a
> lot coming in that had still-open FileDescriptors.
> I'd appreciate further testing.
>
>
> It'd be worthwhile to look at optimizing further to block
> any attempt to call getLastModified() on a JAR, but
> for now I'm hoping it'll be enough to close up all URLConnections.
> In a bit of googling, it'd seem that this has bitten a lot
> of developers.
>
>
> -- Adam
>
>
>
>
>
>
>
>
> > Maybe we could create a kind of ResourceDescriptor file that would include
> two URLs, the real one and the container file's (the .jar URL for instance,
> but would be the same as the real URL most of the time). The getLastModified
> method of the ResourceDescriptor could then use that second URL for purpose
> of modification checks, theorically preventing the JVM from opening the JAR
> file.
> >
> >
> > Regards,
> >
> > ~ Simon
> >
> >
> >
> > On 6/21/07, Adam Winer < awiner@gmail.com> wrote:
> > > I think I've found the problem - Trinidad calls
> > > URLConnection.getLastModified() in a number
> > > of places.  If that's pointing at an URL from
> > > inside a JAR, this will implicitly open the
> > > JAR file, and not release the file until GC.
> > > Looking at solutions now.
> > >
> > >
> > > -- Adam
> > >
> > >
> > >
> > >
> > > On 6/21/07, Fleischer Peter
> <pe...@munich-airport.de> wrote:
> > > >
> > > >
> > > > The problem is reproducable. After restarting tomcat and some requests
> to my application the jar file will again be opened multiple times. Every
> (initial?) request to a page increases the number. Eventually after some
> time the files are garbage collected.
> > > >
> > > > Peter
> > > >
> > > > -----Ursprüngliche Nachricht-----
> > > > Von: Scott O'Bryan [mailto:darkarena@gmail.com]
> > > > Gesendet: Donnerstag, 21. Juni 2007 00:29
> > > > An: MyFaces Discussion
> > > > Betreff: Re: [Trinidad] Causing Too many open files error?
> > > >
> > > >
> > > > I saw this as well using Oracle JDeveloper so I agree that I don't
> think this is a Tomcat issue.  I'm not sure what might be causing this
> though because I shut down my webserver and restarted it and everything has
> been working fine since.
> > > >
> > > > What happens when you restart tomcat?
> > > >
> > > > Scott
> > > >
> > > >
> > > > On 6/20/07, Fleischer Peter
> <peter.fleischer@munich-airport.de > wrote:
> > > > > Hello,
> > > > >
> > > > > we are developing a quite simple application based on MyFaces,
> Trinidad and Facelets. After deploying this application to a Tomcat 5.5.23
> and using the application for a while we are facing connection errors in
> Tomcat caused by too many open files.
> > > > >
> > > > > Checking the running Tomcat process with lsof (list open files) we
> discovered, that  <application>/WEB-INF/lib/trinidad-
> impl-1.0.1-incubating-SNAPSHOT.jar was open for about 300
> times. The number rises with every request. At some time eventually a
> garbage collection closes all these files.
> > > > >
> > > > > I don't think this is a Tomcat error, because this jar is the only
> jar file opened so many times. Perhaps some Trinidad code fails to close a
> file? Is this a known issue?
> > > > >
> > > > > Many thanks in advance.
> > > > >
> > > > > Peter Fleischer
> > > > >
> > > > >
> _____________________________________________________________
> > > > >
> > > > > Munich Airport International
> > > > > Flughafen München GmbH
> > > > > Peter Fleischer
> > > > > ITED Competence Center Application Development
> > > > > Support Division Information Technology
> > > > > P. O. Box  23 17 55
> > > > > 85326 München
> > > > > Phone: +49 89 975-3 24 30
> > > > > Fax: +49 89 975-3 24 06
> > > > > <mailto:peter.fleischer@munich-airport .de >
> > > > >
> > > > > Vorsitzender des Aufsichtsrats: - Chairman of the Supervisory Board:
> > > > > Staatsminister Prof. Dr. Kurt Faltlhauser
> > > > > Geschäftsführung: - Executive Board:
> > > > > Dr. Michael Kerkloh, Walter Vill und Peter Trautmann
> > > > > Handelsregister: - Commercial Register: RG München, HR-Nr. B 5448
> > > > > Sitz der Gesellschaft: - Registered Office: München
> > > > >
> _____________________________________________________________
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>

Re: [Trinidad] Causing Too many open files error?

Posted by Adam Winer <aw...@gmail.com>.
These files should at most get locked once, and only at
startup, and the first GC should flush them...  Are you
really seeing repeated locks on these files?  Could
you show your web.xml?

-- Adam



On 6/29/07, Fleischer Peter <pe...@munich-airport.de> wrote:
>
>
> Hi Adam,
>
> yesterday Matthias sent me a 1.0.2-SNAPSHOT (tanks again!). I did some
> further testing with Tomcat and having the antiJarLocking option set to true
> in the the context.xml. With these settings I think I was able to track down
> the problem to a list of filenames as follows:
>
>
> java    12738 tomcat   65r  VREG         85,40    26783  270804
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/adf/styles/cache/fmg-desktop-1745436599-ie-6-cmp.css
> java    12738 tomcat   66r  VREG         85,40     2961 2719345
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/CharSets.js
> java    12738 tomcat   67r  VREG         85,40    18937 2719361
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/CoreFormat.js
> java    12738 tomcat   68r  VREG         85,40     3292 2719346
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateField.js
> java    12738 tomcat   69r  VREG         85,40      365 2719356
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateFieldFormat.js
> java    12738 tomcat   70r  VREG         85,40    12361 2719350
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateFormat.js
> java    12738 tomcat   71r  VREG         85,40    10945 2719358
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Locale.js
> java    12738 tomcat   72r  VREG         85,40    44505 2719364
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Core.js
> java    12738 tomcat   73r  VREG         85,40     4944 2719342
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Window.js
> java    12738 tomcat   74r  VREG         85,40     3267 2719355
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/TableProxy.js
> java    12738 tomcat   75r  VREG         85,40     1021 2719259
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Poll.js
> java    12738 tomcat   76r  VREG         85,40     2918 2719348
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorField.js
> java    12738 tomcat   77r  VREG         85,40      391 2719357
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorFieldFormat.js
> java    12738 tomcat   78r  VREG         85,40     5857 2719351
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorFormat.js
> java    12738 tomcat   79r  VREG         85,40    18382 2719353
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Shuttle.js
> java    12738 tomcat   80r  VREG         85,40     4648 2719363
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Page.js
> java    12738 tomcat   81r  VREG         85,40      639 2719362
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/StatusIndicator.js
> java    12738 tomcat   82r  VREG         85,40    10520 2791503
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/RequestQueue.js
> java    12738 tomcat   83r  VREG         85,40     2041 2791500
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/XMLRequest.js
> java    12738 tomcat   84r  VREG         85,40     1630 2791501
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/XMLRequestEvent.js
> java    12738 tomcat   85r  VREG         85,40     1594 2791502
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/IFrameXMLRequestEvent.js
> java    12738 tomcat   86r  VREG         85,40       86 2653467
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/images/t.gif
> java    12738 tomcat   87r  VREG         85,40       86 2653467
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/images/t.gif
> java    12738 tomcat   88r  VREG         85,40       86 2653467
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/images/t.gif
> java    12738 tomcat   90r  VREG         85,40    26783  270804
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/adf/styles/cache/fmg-desktop-1745436599-ie-6-cmp.css
> java    12738 tomcat   91r  VREG         85,40    26783  270804
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/adf/styles/cache/fmg-desktop-1745436599-ie-6-cmp.css
> java    12738 tomcat   92r  VREG         85,40     2961 2719345
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/CharSets.js
> java    12738 tomcat   93r  VREG         85,40    18937 2719361
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/CoreFormat.js
> java    12738 tomcat   94r  VREG         85,40     3292 2719346
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateField.js
> java    12738 tomcat   95r  VREG         85,40      365 2719356
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateFieldFormat.js
> java    12738 tomcat   96r  VREG         85,40    12361 2719350
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateFormat.js
> java    12738 tomcat   97r  VREG         85,40    10945 2719358
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Locale.js
> java    12738 tomcat   98r  VREG         85,40    44505 2719364
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Core.js
> java    12738 tomcat   99r  VREG         85,40     4944 2719342
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Window.js
> java    12738 tomcat  100r  VREG         85,40     3267 2719355
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/TableProxy.js
> java    12738 tomcat  101r  VREG         85,40     1021 2719259
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Poll.js
> java    12738 tomcat  102r  VREG         85,40     2918 2719348
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorField.js
> java    12738 tomcat  103r  VREG         85,40      391 2719357
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorFieldFormat.js
> java    12738 tomcat  104r  VREG         85,40     5857 2719351
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorFormat.js
> java    12738 tomcat  105r  VREG         85,40    18382 2719353
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Shuttle.js
> java    12738 tomcat  106r  VREG         85,40     4648 2719363
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Page.js
> java    12738 tomcat  107r  VREG         85,40      639 2719362
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/StatusIndicator.js
> java    12738 tomcat  108r  VREG         85,40    10520 2791503
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/RequestQueue.js
> java    12738 tomcat  109r  VREG         85,40     2041 2791500
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/XMLRequest.js
> java    12738 tomcat  110r  VREG         85,40     1630 2791501
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/XMLRequestEvent.js
> java    12738 tomcat  111r  VREG         85,40     1594 2791502
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/IFrameXMLRequestEvent.js
> java    12738 tomcat  112r  VREG         85,40     2961 2719345
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/CharSets.js
> java    12738 tomcat  113r  VREG         85,40    18937 2719361
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/CoreFormat.js
> java    12738 tomcat  114r  VREG         85,40     3292 2719346
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateField.js
> java    12738 tomcat  115r  VREG         85,40      365 2719356
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateFieldFormat.js
> java    12738 tomcat  116r  VREG         85,40    12361 2719350
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateFormat.js
> java    12738 tomcat  117r  VREG         85,40    10945 2719358
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Locale.js
> java    12738 tomcat  118r  VREG         85,40    44505 2719364
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Core.js
> java    12738 tomcat  119r  VREG         85,40     4944 2719342
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Window.js
> java    12738 tomcat  120r  VREG         85,40     3267 2719355
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/TableProxy.js
> java    12738 tomcat  121r  VREG         85,40     1021 2719259
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Poll.js
> java    12738 tomcat  122r  VREG         85,40     2918 2719348
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorField.js
> java    12738 tomcat  123r  VREG         85,40      391 2719357
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorFieldFormat.js
> java    12738 tomcat  124r  VREG         85,40     5857 2719351
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorFormat.js
> java    12738 tomcat  125r  VREG         85,40    18382 2719353
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Shuttle.js
> java    12738 tomcat  126r  VREG         85,40     4648 2719363
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Page.js
> java    12738 tomcat  127r  VREG         85,40      639 2719362
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/StatusIndicator.js
> java    12738 tomcat  128r  VREG         85,40    10520 2791503
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/RequestQueue.js
> java    12738 tomcat  129r  VREG         85,40     2041 2791500
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/XMLRequest.js
> java    12738 tomcat  130r  VREG         85,40     1630 2791501
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/XMLRequestEvent.js
> java    12738 tomcat  131r  VREG         85,40     1594 2791502
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/IFrameXMLRequestEvent.js
> java    12738 tomcat  133r  VREG         85,40      286 2653419
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/images/list-bullet.gif
> java    12738 tomcat  134r  VREG         85,40      417 2653475
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/images/siready.gif
> java    12738 tomcat  135r  VREG         85,40      781 2653474
> /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/images/sibusy.gif
>
>
> This was tested with clearing the browser cache in before doing any requests
> to my application and navigating around a little bit. Repeating this test
> with a second browser (also clean cache) duplicated the count of open files.
>
> For now we manually do a GC in our application every 5 minutes to alleviate
> the problem but this is certainly only a quick&dirty solution.
>
> Peter
>
>
> -----Ursprüngliche Nachricht-----
> Von: Adam Winer [mailto:awiner@gmail.com]
> Gesendet: Donnerstag, 21. Juni 2007 23:29
>
> An: MyFaces Discussion
> Betreff: Re: [Trinidad] Causing Too many open files error?
>
>
> On 6/21/07, Simon Lessard <si...@gmail.com> wrote:
> > Hmmm, I assume this is used mainly to detect skin files' version?
>
>
>
> It's used in a bunch of places to detect modification - skin
> files, ResourceServlet, jsp modifications, etc.
> I've checked in a fix that should resolve this,
> but I'm not 100% sure.  I've mostly been looking at
> the calls to FileInputStream.finalize() - there were a
> lot coming in that had still-open FileDescriptors.
> I'd appreciate further testing.
>
>
> It'd be worthwhile to look at optimizing further to block
> any attempt to call getLastModified() on a JAR, but
> for now I'm hoping it'll be enough to close up all URLConnections.
> In a bit of googling, it'd seem that this has bitten a lot
> of developers.
>
>
> -- Adam
>
>
>
>
>
>
>
>
> > Maybe we could create a kind of ResourceDescriptor file that would include
> two URLs, the real one and the container file's (the .jar URL for instance,
> but would be the same as the real URL most of the time). The getLastModified
> method of the ResourceDescriptor could then use that second URL for purpose
> of modification checks, theorically preventing the JVM from opening the JAR
> file.
> >
> >
> > Regards,
> >
> > ~ Simon
> >
> >
> >
> > On 6/21/07, Adam Winer < awiner@gmail.com> wrote:
> > > I think I've found the problem - Trinidad calls
> > > URLConnection.getLastModified() in a number
> > > of places.  If that's pointing at an URL from
> > > inside a JAR, this will implicitly open the
> > > JAR file, and not release the file until GC.
> > > Looking at solutions now.
> > >
> > >
> > > -- Adam
> > >
> > >
> > >
> > >
> > > On 6/21/07, Fleischer Peter
> <pe...@munich-airport.de> wrote:
> > > >
> > > >
> > > > The problem is reproducable. After restarting tomcat and some requests
> to my application the jar file will again be opened multiple times. Every
> (initial?) request to a page increases the number. Eventually after some
> time the files are garbage collected.
> > > >
> > > > Peter
> > > >
> > > > -----Ursprüngliche Nachricht-----
> > > > Von: Scott O'Bryan [mailto:darkarena@gmail.com]
> > > > Gesendet: Donnerstag, 21. Juni 2007 00:29
> > > > An: MyFaces Discussion
> > > > Betreff: Re: [Trinidad] Causing Too many open files error?
> > > >
> > > >
> > > > I saw this as well using Oracle JDeveloper so I agree that I don't
> think this is a Tomcat issue.  I'm not sure what might be causing this
> though because I shut down my webserver and restarted it and everything has
> been working fine since.
> > > >
> > > > What happens when you restart tomcat?
> > > >
> > > > Scott
> > > >
> > > >
> > > > On 6/20/07, Fleischer Peter
> <peter.fleischer@munich-airport.de > wrote:
> > > > > Hello,
> > > > >
> > > > > we are developing a quite simple application based on MyFaces,
> Trinidad and Facelets. After deploying this application to a Tomcat 5.5.23
> and using the application for a while we are facing connection errors in
> Tomcat caused by too many open files.
> > > > >
> > > > > Checking the running Tomcat process with lsof (list open files) we
> discovered, that  <application>/WEB-INF/lib/trinidad-
> impl-1.0.1-incubating-SNAPSHOT.jar was open for about 300
> times. The number rises with every request. At some time eventually a
> garbage collection closes all these files.
> > > > >
> > > > > I don't think this is a Tomcat error, because this jar is the only
> jar file opened so many times. Perhaps some Trinidad code fails to close a
> file? Is this a known issue?
> > > > >
> > > > > Many thanks in advance.
> > > > >
> > > > > Peter Fleischer
> > > > >
> > > > >
> _____________________________________________________________
> > > > >
> > > > > Munich Airport International
> > > > > Flughafen München GmbH
> > > > > Peter Fleischer
> > > > > ITED Competence Center Application Development
> > > > > Support Division Information Technology
> > > > > P. O. Box  23 17 55
> > > > > 85326 München
> > > > > Phone: +49 89 975-3 24 30
> > > > > Fax: +49 89 975-3 24 06
> > > > > <mailto:peter.fleischer@munich-airport .de >
> > > > >
> > > > > Vorsitzender des Aufsichtsrats: - Chairman of the Supervisory Board:
> > > > > Staatsminister Prof. Dr. Kurt Faltlhauser
> > > > > Geschäftsführung: - Executive Board:
> > > > > Dr. Michael Kerkloh, Walter Vill und Peter Trautmann
> > > > > Handelsregister: - Commercial Register: RG München, HR-Nr. B 5448
> > > > > Sitz der Gesellschaft: - Registered Office: München
> > > > >
> _____________________________________________________________
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>

Re: [Trinidad] Causing Too many open files error?

Posted by mi...@convergys.com.
Will this fix also have been applied to the 1.2 branch?



"Adam Winer" <aw...@gmail.com> wrote on 06/21/2007 05:28:32 PM:

> On 6/21/07, Simon Lessard <si...@gmail.com> wrote:
> Hmmm, I assume this is used mainly to detect skin files' version? 
> 
> 
> It's used in a bunch of places to detect modification - skin
> files, ResourceServlet, jsp modifications, etc. 
> I've checked in a fix that should resolve this,
> but I'm not 100% sure.  I've mostly been looking at
> the calls to FileInputStream.finalize() - there were a
> lot coming in that had still-open FileDescriptors. 
> I'd appreciate further testing.
> 
> It'd be worthwhile to look at optimizing further to block
> any attempt to call getLastModified() on a JAR, but 
> for now I'm hoping it'll be enough to close up all URLConnections.
> In a bit of googling, it'd seem that this has bitten a lot
> of developers.
> 
> -- Adam
> 
> Maybe we could create a kind of ResourceDescriptor file that would 
> include two URLs, the real one and the container file's (the .jar 
> URL for instance, but would be the same as the real URL most of the 
> time). The getLastModified method of the ResourceDescriptor could 
> then use that second URL for purpose of modification checks, 
> theorically preventing the JVM from opening the JAR file. 
> 
> 
> Regards,
> 
> ~ Simon
> 

> On 6/21/07, Adam Winer < awiner@gmail.com> wrote:
> I think I've found the problem - Trinidad calls
> URLConnection.getLastModified() in a number
> of places.  If that's pointing at an URL from
> inside a JAR, this will implicitly open the
> JAR file, and not release the file until GC.
> Looking at solutions now.
> 
> 
> -- Adam
> 

> On 6/21/07, Fleischer Peter <pe...@munich-airport.de> wrote:
> The problem is reproducable. After restarting tomcat and some 
> requests to my application the jar file will again be opened 
> multiple times. Every (initial?) request to a page increases the 
> number. Eventually after some time the files are garbage collected.
> 
> Peter
> -----Ursprüngliche Nachricht-----
> Von: Scott O'Bryan [mailto:darkarena@gmail.com]
> Gesendet: Donnerstag, 21. Juni 2007 00:29
> An: MyFaces Discussion
> Betreff: Re: [Trinidad] Causing Too many open files error?

> I saw this as well using Oracle JDeveloper so I agree that I don't 
> think this is a Tomcat issue.  I'm not sure what might be causing 
> this though because I shut down my webserver and restarted it and 
> everything has been working fine since. 
> 
> What happens when you restart tomcat?
> 
> Scott

> On 6/20/07, Fleischer Peter <peter.fleischer@munich-airport.de > wrote: 
> Hello,
> 
> we are developing a quite simple application based on MyFaces, 
> Trinidad and Facelets. After deploying this application to a Tomcat 
> 5.5.23 and using the application for a while we are facing 
> connection errors in Tomcat caused by too many open files.
> 
> Checking the running Tomcat process with lsof (list open files) we 
> discovered, that  <application>/WEB-INF/lib/trinidad- impl-1.0.1-
> incubating-SNAPSHOT.jar was open for about 300 times. The number 
> rises with every request. At some time eventually a garbage 
> collection closes all these files.
> 
> I don't think this is a Tomcat error, because this jar is the only 
> jar file opened so many times. Perhaps some Trinidad code fails to 
> close a file? Is this a known issue? 
> 
> Many thanks in advance.
> 
> Peter Fleischer
> 
> _____________________________________________________________
> 
> Munich Airport International
> Flughafen München GmbH
> Peter Fleischer
> ITED Competence Center Application Development 
> Support Division Information Technology
> P. O. Box  23 17 55
> 85326 München
> Phone: +49 89 975-3 24 30
> Fax: +49 89 975-3 24 06
> <mailto:peter.fleischer@munich-airport .de >
> 
> Vorsitzender des Aufsichtsrats: - Chairman of the Supervisory Board:
> Staatsminister Prof. Dr. Kurt Faltlhauser
> Geschäftsführung: - Executive Board:
> Dr. Michael Kerkloh, Walter Vill und Peter Trautmann 
> Handelsregister: - Commercial Register: RG München, HR-Nr. B 5448
> Sitz der Gesellschaft: - Registered Office: München
> _____________________________________________________________

> 
> 
> 

AW: [Trinidad] Causing Too many open files error?

Posted by Fleischer Peter <pe...@munich-airport.de>.
Hi Adam,
 
yesterday Matthias sent me a 1.0.2-SNAPSHOT (tanks again!). I did some further testing with Tomcat and having the antiJarLocking option set to true in the the context.xml. With these settings I think I was able to track down the problem to a list of filenames as follows:
 
 
java    12738 tomcat   65r  VREG         85,40    26783  270804 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/adf/styles/cache/fmg-desktop-1745436599-ie-6-cmp.css
java    12738 tomcat   66r  VREG         85,40     2961 2719345 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/CharSets.js
java    12738 tomcat   67r  VREG         85,40    18937 2719361 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/CoreFormat.js
java    12738 tomcat   68r  VREG         85,40     3292 2719346 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateField.js
java    12738 tomcat   69r  VREG         85,40      365 2719356 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateFieldFormat.js
java    12738 tomcat   70r  VREG         85,40    12361 2719350 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateFormat.js
java    12738 tomcat   71r  VREG         85,40    10945 2719358 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Locale.js
java    12738 tomcat   72r  VREG         85,40    44505 2719364 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Core.js
java    12738 tomcat   73r  VREG         85,40     4944 2719342 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Window.js
java    12738 tomcat   74r  VREG         85,40     3267 2719355 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/TableProxy.js
java    12738 tomcat   75r  VREG         85,40     1021 2719259 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Poll.js
java    12738 tomcat   76r  VREG         85,40     2918 2719348 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorField.js
java    12738 tomcat   77r  VREG         85,40      391 2719357 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorFieldFormat.js
java    12738 tomcat   78r  VREG         85,40     5857 2719351 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorFormat.js
java    12738 tomcat   79r  VREG         85,40    18382 2719353 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Shuttle.js
java    12738 tomcat   80r  VREG         85,40     4648 2719363 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Page.js
java    12738 tomcat   81r  VREG         85,40      639 2719362 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/StatusIndicator.js
java    12738 tomcat   82r  VREG         85,40    10520 2791503 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/RequestQueue.js
java    12738 tomcat   83r  VREG         85,40     2041 2791500 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/XMLRequest.js
java    12738 tomcat   84r  VREG         85,40     1630 2791501 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/XMLRequestEvent.js
java    12738 tomcat   85r  VREG         85,40     1594 2791502 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/IFrameXMLRequestEvent.js
java    12738 tomcat   86r  VREG         85,40       86 2653467 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/images/t.gif
java    12738 tomcat   87r  VREG         85,40       86 2653467 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/images/t.gif
java    12738 tomcat   88r  VREG         85,40       86 2653467 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/images/t.gif
java    12738 tomcat   90r  VREG         85,40    26783  270804 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/adf/styles/cache/fmg-desktop-1745436599-ie-6-cmp.css
java    12738 tomcat   91r  VREG         85,40    26783  270804 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/adf/styles/cache/fmg-desktop-1745436599-ie-6-cmp.css
java    12738 tomcat   92r  VREG         85,40     2961 2719345 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/CharSets.js
java    12738 tomcat   93r  VREG         85,40    18937 2719361 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/CoreFormat.js
java    12738 tomcat   94r  VREG         85,40     3292 2719346 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateField.js
java    12738 tomcat   95r  VREG         85,40      365 2719356 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateFieldFormat.js
java    12738 tomcat   96r  VREG         85,40    12361 2719350 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateFormat.js
java    12738 tomcat   97r  VREG         85,40    10945 2719358 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Locale.js
java    12738 tomcat   98r  VREG         85,40    44505 2719364 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Core.js
java    12738 tomcat   99r  VREG         85,40     4944 2719342 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Window.js
java    12738 tomcat  100r  VREG         85,40     3267 2719355 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/TableProxy.js
java    12738 tomcat  101r  VREG         85,40     1021 2719259 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Poll.js
java    12738 tomcat  102r  VREG         85,40     2918 2719348 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorField.js
java    12738 tomcat  103r  VREG         85,40      391 2719357 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorFieldFormat.js
java    12738 tomcat  104r  VREG         85,40     5857 2719351 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorFormat.js
java    12738 tomcat  105r  VREG         85,40    18382 2719353 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Shuttle.js
java    12738 tomcat  106r  VREG         85,40     4648 2719363 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Page.js
java    12738 tomcat  107r  VREG         85,40      639 2719362 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/StatusIndicator.js
java    12738 tomcat  108r  VREG         85,40    10520 2791503 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/RequestQueue.js
java    12738 tomcat  109r  VREG         85,40     2041 2791500 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/XMLRequest.js
java    12738 tomcat  110r  VREG         85,40     1630 2791501 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/XMLRequestEvent.js
java    12738 tomcat  111r  VREG         85,40     1594 2791502 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/IFrameXMLRequestEvent.js
java    12738 tomcat  112r  VREG         85,40     2961 2719345 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/CharSets.js
java    12738 tomcat  113r  VREG         85,40    18937 2719361 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/CoreFormat.js
java    12738 tomcat  114r  VREG         85,40     3292 2719346 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateField.js
java    12738 tomcat  115r  VREG         85,40      365 2719356 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateFieldFormat.js
java    12738 tomcat  116r  VREG         85,40    12361 2719350 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/DateFormat.js
java    12738 tomcat  117r  VREG         85,40    10945 2719358 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Locale.js
java    12738 tomcat  118r  VREG         85,40    44505 2719364 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Core.js
java    12738 tomcat  119r  VREG         85,40     4944 2719342 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Window.js
java    12738 tomcat  120r  VREG         85,40     3267 2719355 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/TableProxy.js
java    12738 tomcat  121r  VREG         85,40     1021 2719259 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Poll.js
java    12738 tomcat  122r  VREG         85,40     2918 2719348 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorField.js
java    12738 tomcat  123r  VREG         85,40      391 2719357 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorFieldFormat.js
java    12738 tomcat  124r  VREG         85,40     5857 2719351 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/ColorFormat.js
java    12738 tomcat  125r  VREG         85,40    18382 2719353 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Shuttle.js
java    12738 tomcat  126r  VREG         85,40     4648 2719363 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/Page.js
java    12738 tomcat  127r  VREG         85,40      639 2719362 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/StatusIndicator.js
java    12738 tomcat  128r  VREG         85,40    10520 2791503 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/RequestQueue.js
java    12738 tomcat  129r  VREG         85,40     2041 2791500 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/XMLRequest.js
java    12738 tomcat  130r  VREG         85,40     1630 2791501 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/XMLRequestEvent.js
java    12738 tomcat  131r  VREG         85,40     1594 2791502 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/jsLibs/xhr/IFrameXMLRequestEvent.js
java    12738 tomcat  133r  VREG         85,40      286 2653419 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/images/list-bullet.gif
java    12738 tomcat  134r  VREG         85,40      417 2653475 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/images/siready.gif
java    12738 tomcat  135r  VREG         85,40      781 2653474 /home/tomcat/CATALINA_BASE/work/Catalina/localhost/weasel/loader/META-INF/adf/images/sibusy.gif

 
This was tested with clearing the browser cache in before doing any requests to my application and navigating around a little bit. Repeating this test with a second browser (also clean cache) duplicated the count of open files.
 
For now we manually do a GC in our application every 5 minutes to alleviate the problem but this is certainly only a quick&dirty solution.
 
Peter
 

-----Ursprüngliche Nachricht-----
Von: Adam Winer [mailto:awiner@gmail.com]
Gesendet: Donnerstag, 21. Juni 2007 23:29
An: MyFaces Discussion
Betreff: Re: [Trinidad] Causing Too many open files error?


On 6/21/07, Simon Lessard < simon.lessard.3@gmail.com> wrote: 

Hmmm, I assume this is used mainly to detect skin files' version? 


 
It's used in a bunch of places to detect modification - skin
files, ResourceServlet, jsp modifications, etc. 
I've checked in a fix that should resolve this,
but I'm not 100% sure.  I've mostly been looking at
the calls to FileInputStream.finalize() - there were a
lot coming in that had still-open FileDescriptors. 
I'd appreciate further testing.

It'd be worthwhile to look at optimizing further to block
any attempt to call getLastModified() on a JAR, but 
for now I'm hoping it'll be enough to close up all URLConnections.
In a bit of googling, it'd seem that this has bitten a lot
of developers.

-- Adam





Maybe we could create a kind of ResourceDescriptor file that would include two URLs, the real one and the container file's (the .jar URL for instance, but would be the same as the real URL most of the time). The getLastModified method of the ResourceDescriptor could then use that second URL for purpose of modification checks, theorically preventing the JVM from opening the JAR file. 


Regards,

~ Simon 



On 6/21/07, Adam Winer <  <ma...@gmail.com> awiner@gmail.com> wrote: 

I think I've found the problem - Trinidad calls 
URLConnection.getLastModified() in a number
of places.  If that's pointing at an URL from
inside a JAR, this will implicitly open the
JAR file, and not release the file until GC.
Looking at solutions now.


 
-- Adam



On 6/21/07, Fleischer Peter < peter.fleischer@munich-airport.de> wrote: 

The problem is reproducable. After restarting tomcat and some requests to my application the jar file will again be opened multiple times. Every (initial?) request to a page increases the number. Eventually after some time the files are garbage collected.
 
Peter

-----Ursprüngliche Nachricht-----
Von: Scott O'Bryan [mailto: darkarena@gmail.com]
Gesendet: Donnerstag, 21. Juni 2007 00:29
An: MyFaces Discussion
Betreff: Re: [Trinidad] Causing Too many open files error?


I saw this as well using Oracle JDeveloper so I agree that I don't think this is a Tomcat issue.  I'm not sure what might be causing this though because I shut down my webserver and restarted it and everything has been working fine since. 

What happens when you restart tomcat?

Scott


On 6/20/07, Fleischer Peter < peter.fleischer@munich-airport.de  <ma...@munich-airport.de> > wrote: 

Hello,

we are developing a quite simple application based on MyFaces, Trinidad and Facelets. After deploying this application to a Tomcat 5.5.23 and using the application for a while we are facing connection errors in Tomcat caused by too many open files.

Checking the running Tomcat process with lsof (list open files) we discovered, that  <application>/WEB-INF/lib/trinidad- impl-1.0.1-incubating-SNAPSHOT.jar was open for about 300 times. The number rises with every request. At some time eventually a garbage collection closes all these files.

I don't think this is a Tomcat error, because this jar is the only jar file opened so many times. Perhaps some Trinidad code fails to close a file? Is this a known issue? 

Many thanks in advance.

Peter Fleischer

_____________________________________________________________

Munich Airport International
Flughafen München GmbH
Peter Fleischer
ITED Competence Center Application Development 
Support Division Information Technology
P. O. Box  23 17 55
85326 München
Phone: +49 89 975-3 24 30
Fax: +49 89 975-3 24 06
<mailto: peter.fleischer@munich-airport <ma...@munich-airport.de>   <ma...@munich-airport.de> .de >

Vorsitzender des Aufsichtsrats: - Chairman of the Supervisory Board:
Staatsminister Prof. Dr. Kurt Faltlhauser
Geschäftsführung: - Executive Board:
Dr. Michael Kerkloh, Walter Vill und Peter Trautmann 
Handelsregister: - Commercial Register: RG München, HR-Nr. B 5448
Sitz der Gesellschaft: - Registered Office: München
_____________________________________________________________





 




Re: [Trinidad] Causing Too many open files error?

Posted by Adam Winer <aw...@gmail.com>.
On 6/21/07, Simon Lessard <si...@gmail.com> wrote:
>
> Hmmm, I assume this is used mainly to detect skin files' version?



It's used in a bunch of places to detect modification - skin
files, ResourceServlet, jsp modifications, etc.
I've checked in a fix that should resolve this,
but I'm not 100% sure.  I've mostly been looking at
the calls to FileInputStream.finalize() - there were a
lot coming in that had still-open FileDescriptors.
I'd appreciate further testing.

It'd be worthwhile to look at optimizing further to block
any attempt to call getLastModified() on a JAR, but
for now I'm hoping it'll be enough to close up all URLConnections.
In a bit of googling, it'd seem that this has bitten a lot
of developers.

-- Adam




Maybe we could create a kind of ResourceDescriptor file that would include
> two URLs, the real one and the container file's (the .jar URL for instance,
> but would be the same as the real URL most of the time). The getLastModified
> method of the ResourceDescriptor could then use that second URL for purpose
> of modification checks, theorically preventing the JVM from opening the JAR
> file.
>
>
> Regards,
>
> ~ Simon
>
> On 6/21/07, Adam Winer <aw...@gmail.com> wrote:
> >
> > I think I've found the problem - Trinidad calls
> > URLConnection.getLastModified() in a number
> > of places.  If that's pointing at an URL from
> > inside a JAR, this will implicitly open the
> > JAR file, and not release the file until GC.
> > Looking at solutions now.
> >
> >
> > -- Adam
> >
> >
> > On 6/21/07, Fleischer Peter <pe...@munich-airport.de> wrote:
> > >
> > >  The problem is reproducable. After restarting tomcat and some
> > > requests to my application the jar file will again be opened multiple times.
> > > Every (initial?) request to a page increases the number. Eventually after
> > > some time the files are garbage collected.
> > >
> > > Peter
> > >
> > > -----Ursprüngliche Nachricht-----
> > > *Von:* Scott O'Bryan [mailto:darkarena@gmail.com]
> > > *Gesendet:* Donnerstag, 21. Juni 2007 00:29
> > > *An:* MyFaces Discussion
> > > *Betreff:* Re: [Trinidad] Causing Too many open files error?
> > >
> > > I saw this as well using Oracle JDeveloper so I agree that I don't
> > > think this is a Tomcat issue.  I'm not sure what might be causing this
> > > though because I shut down my webserver and restarted it and everything has
> > > been working fine since.
> > >
> > > What happens when you restart tomcat?
> > >
> > > Scott
> > >
> > > On 6/20/07, Fleischer Peter <peter.fleischer@munich-airport.de >
> > > wrote:
> > > >
> > > > Hello,
> > > >
> > > > we are developing a quite simple application based on MyFaces,
> > > > Trinidad and Facelets. After deploying this application to a Tomcat
> > > > 5.5.23 and using the application for a while we are facing
> > > > connection errors in Tomcat caused by too many open files.
> > > >
> > > > Checking the running Tomcat process with lsof (list open files) we
> > > > discovered, that  <application>/WEB-INF/lib/trinidad-
> > > > impl-1.0.1-incubating-SNAPSHOT.jar was open for about 300 times. The
> > > > number rises with every request. At some time eventually a garbage
> > > > collection closes all these files.
> > > >
> > > > I don't think this is a Tomcat error, because this jar is the only
> > > > jar file opened so many times. Perhaps some Trinidad code fails to close a
> > > > file? Is this a known issue?
> > > >
> > > > Many thanks in advance.
> > > >
> > > > Peter Fleischer
> > > >
> > > > _____________________________________________________________
> > > >
> > > > Munich Airport International
> > > > Flughafen München GmbH
> > > > Peter Fleischer
> > > > ITED Competence Center Application Development
> > > > Support Division Information Technology
> > > > P. O. Box  23 17 55
> > > > 85326 München
> > > > Phone: +49 89 975-3 24 30
> > > > Fax: +49 89 975-3 24 06
> > > > <ma...@munich-airport.de>.de
> > > > <pe...@munich-airport.de>>
> > > >
> > > > Vorsitzender des Aufsichtsrats: - Chairman of the Supervisory Board:
> > > > Staatsminister Prof. Dr. Kurt Faltlhauser
> > > > Geschäftsführung: - Executive Board:
> > > > Dr. Michael Kerkloh, Walter Vill und Peter Trautmann
> > > > Handelsregister: - Commercial Register: RG München, HR-Nr. B 5448
> > > > Sitz der Gesellschaft: - Registered Office: München
> > > > _____________________________________________________________
> > > >
> > > >
> > >
> >
> >
>
>

Re: [Trinidad] Causing Too many open files error?

Posted by Simon Lessard <si...@gmail.com>.
Hmmm, I assume this is used mainly to detect skin files' version?

Maybe we could create a kind of ResourceDescriptor file that would include
two URLs, the real one and the container file's (the .jar URL for instance,
but would be the same as the real URL most of the time). The getLastModified
method of the ResourceDescriptor could then use that second URL for purpose
of modification checks, theorically preventing the JVM from opening the JAR
file.


Regards,

~ Simon

On 6/21/07, Adam Winer <aw...@gmail.com> wrote:
>
> I think I've found the problem - Trinidad calls
> URLConnection.getLastModified() in a number
> of places.  If that's pointing at an URL from
> inside a JAR, this will implicitly open the
> JAR file, and not release the file until GC.
> Looking at solutions now.
>
> -- Adam
>
>
> On 6/21/07, Fleischer Peter <pe...@munich-airport.de> wrote:
> >
> >  The problem is reproducable. After restarting tomcat and some requests
> > to my application the jar file will again be opened multiple times. Every
> > (initial?) request to a page increases the number. Eventually after some
> > time the files are garbage collected.
> >
> > Peter
> >
> > -----Ursprüngliche Nachricht-----
> > *Von:* Scott O'Bryan [mailto:darkarena@gmail.com]
> > *Gesendet:* Donnerstag, 21. Juni 2007 00:29
> > *An:* MyFaces Discussion
> > *Betreff:* Re: [Trinidad] Causing Too many open files error?
> >
> > I saw this as well using Oracle JDeveloper so I agree that I don't think
> > this is a Tomcat issue.  I'm not sure what might be causing this though
> > because I shut down my webserver and restarted it and everything has been
> > working fine since.
> >
> > What happens when you restart tomcat?
> >
> > Scott
> >
> > On 6/20/07, Fleischer Peter <peter.fleischer@munich-airport.de > wrote:
> > >
> > > Hello,
> > >
> > > we are developing a quite simple application based on MyFaces,
> > > Trinidad and Facelets. After deploying this application to a Tomcat
> > > 5.5.23 and using the application for a while we are facing connection
> > > errors in Tomcat caused by too many open files.
> > >
> > > Checking the running Tomcat process with lsof (list open files) we
> > > discovered, that  <application>/WEB-INF/lib/trinidad-
> > > impl-1.0.1-incubating-SNAPSHOT.jar was open for about 300 times. The
> > > number rises with every request. At some time eventually a garbage
> > > collection closes all these files.
> > >
> > > I don't think this is a Tomcat error, because this jar is the only jar
> > > file opened so many times. Perhaps some Trinidad code fails to close a file?
> > > Is this a known issue?
> > >
> > > Many thanks in advance.
> > >
> > > Peter Fleischer
> > >
> > > _____________________________________________________________
> > >
> > > Munich Airport International
> > > Flughafen München GmbH
> > > Peter Fleischer
> > > ITED Competence Center Application Development
> > > Support Division Information Technology
> > > P. O. Box  23 17 55
> > > 85326 München
> > > Phone: +49 89 975-3 24 30
> > > Fax: +49 89 975-3 24 06
> > > <ma...@munich-airport.de>.de
> > > <pe...@munich-airport.de>>
> > >
> > > Vorsitzender des Aufsichtsrats: - Chairman of the Supervisory Board:
> > > Staatsminister Prof. Dr. Kurt Faltlhauser
> > > Geschäftsführung: - Executive Board:
> > > Dr. Michael Kerkloh, Walter Vill und Peter Trautmann
> > > Handelsregister: - Commercial Register: RG München, HR-Nr. B 5448
> > > Sitz der Gesellschaft: - Registered Office: München
> > > _____________________________________________________________
> > >
> > >
> >
>
>

Re: [Trinidad] Causing Too many open files error?

Posted by Adam Winer <aw...@gmail.com>.
I think I've found the problem - Trinidad callsURLConnection.getLastModified()
in a number
of places.  If that's pointing at an URL from
inside a JAR, this will implicitly open the
JAR file, and not release the file until GC.
Looking at solutions now.

-- Adam


On 6/21/07, Fleischer Peter <pe...@munich-airport.de> wrote:
>
>  The problem is reproducable. After restarting tomcat and some requests to
> my application the jar file will again be opened multiple times. Every
> (initial?) request to a page increases the number. Eventually after some
> time the files are garbage collected.
>
> Peter
>
> -----Ursprüngliche Nachricht-----
> *Von:* Scott O'Bryan [mailto:darkarena@gmail.com]
> *Gesendet:* Donnerstag, 21. Juni 2007 00:29
> *An:* MyFaces Discussion
> *Betreff:* Re: [Trinidad] Causing Too many open files error?
>
> I saw this as well using Oracle JDeveloper so I agree that I don't think
> this is a Tomcat issue.  I'm not sure what might be causing this though
> because I shut down my webserver and restarted it and everything has been
> working fine since.
>
> What happens when you restart tomcat?
>
> Scott
>
> On 6/20/07, Fleischer Peter <peter.fleischer@munich-airport.de > wrote:
> >
> > Hello,
> >
> > we are developing a quite simple application based on MyFaces, Trinidad
> > and Facelets. After deploying this application to a Tomcat 5.5.23 and
> > using the application for a while we are facing connection errors in Tomcat
> > caused by too many open files.
> >
> > Checking the running Tomcat process with lsof (list open files) we
> > discovered, that  <application>/WEB-INF/lib/trinidad-
> > impl-1.0.1-incubating-SNAPSHOT.jar was open for about 300 times. The
> > number rises with every request. At some time eventually a garbage
> > collection closes all these files.
> >
> > I don't think this is a Tomcat error, because this jar is the only jar
> > file opened so many times. Perhaps some Trinidad code fails to close a file?
> > Is this a known issue?
> >
> > Many thanks in advance.
> >
> > Peter Fleischer
> >
> > _____________________________________________________________
> >
> > Munich Airport International
> > Flughafen München GmbH
> > Peter Fleischer
> > ITED Competence Center Application Development
> > Support Division Information Technology
> > P. O. Box  23 17 55
> > 85326 München
> > Phone: +49 89 975-3 24 30
> > Fax: +49 89 975-3 24 06
> > <ma...@munich-airport.de>.de
> > <pe...@munich-airport.de>>
> >
> > Vorsitzender des Aufsichtsrats: - Chairman of the Supervisory Board:
> > Staatsminister Prof. Dr. Kurt Faltlhauser
> > Geschäftsführung: - Executive Board:
> > Dr. Michael Kerkloh, Walter Vill und Peter Trautmann
> > Handelsregister: - Commercial Register: RG München, HR-Nr. B 5448
> > Sitz der Gesellschaft: - Registered Office: München
> > _____________________________________________________________
> >
> >
>

Re: [Trinidad] Causing Too many open files error?

Posted by Martin Marinschek <ma...@gmail.com>.
Hi Peter,

there is a tool from sun (they use it in glassfish) to check which
class/method opened which open file handles. Not sure if it will help
with several open file handles; but can you try to check this out with
your use-case?

http://blogs.sun.com/quinn/entry/tool_for_diagnosing_failed_glassfish

the tool should also work with tomcat (at least I got it to run with
tomcat when I had to).

regards,

Martin

On 6/21/07, Scott O'Bryan <da...@gmail.com> wrote:
> I saw this as well using Oracle JDeveloper so I agree that I don't think
> this is a Tomcat issue.  I'm not sure what might be causing this though
> because I shut down my webserver and restarted it and everything has been
> working fine since.
>
> What happens when you restart tomcat?
>
> Scott
>
>
> On 6/20/07, Fleischer Peter
> <peter.fleischer@munich-airport.de > wrote:
> > Hello,
> >
> > we are developing a quite simple application based on MyFaces, Trinidad
> and Facelets. After deploying this application to a Tomcat 5.5.23 and using
> the application for a while we are facing connection errors in Tomcat caused
> by too many open files.
> >
> > Checking the running Tomcat process with lsof (list open files) we
> discovered, that  <application>/WEB-INF/lib/trinidad-
> impl-1.0.1-incubating-SNAPSHOT.jar was open for about 300
> times. The number rises with every request. At some time eventually a
> garbage collection closes all these files.
> >
> > I don't think this is a Tomcat error, because this jar is the only jar
> file opened so many times. Perhaps some Trinidad code fails to close a file?
> Is this a known issue?
> >
> > Many thanks in advance.
> >
> > Peter Fleischer
> >
> >
> _____________________________________________________________
> >
> > Munich Airport International
> > Flughafen München GmbH
> > Peter Fleischer
> > ITED Competence Center Application Development
> > Support Division Information Technology
> > P. O. Box  23 17 55
> > 85326 München
> > Phone: +49 89 975-3 24 30
> > Fax: +49 89 975-3 24 06
> > <mailto:peter.fleischer@munich-airport.de >
> >
> > Vorsitzender des Aufsichtsrats: - Chairman of the Supervisory Board:
> > Staatsminister Prof. Dr. Kurt Faltlhauser
> > Geschäftsführung: - Executive Board:
> > Dr. Michael Kerkloh, Walter Vill und Peter Trautmann
> > Handelsregister: - Commercial Register: RG München, HR-Nr. B 5448
> > Sitz der Gesellschaft: - Registered Office: München
> >
> _____________________________________________________________
> >
> >
>
>


-- 

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

AW: [Trinidad] Causing Too many open files error?

Posted by Fleischer Peter <pe...@munich-airport.de>.
The problem is reproducable. After restarting tomcat and some requests to my application the jar file will again be opened multiple times. Every (initial?) request to a page increases the number. Eventually after some time the files are garbage collected.
 
Peter

-----Ursprüngliche Nachricht-----
Von: Scott O'Bryan [mailto:darkarena@gmail.com]
Gesendet: Donnerstag, 21. Juni 2007 00:29
An: MyFaces Discussion
Betreff: Re: [Trinidad] Causing Too many open files error?


I saw this as well using Oracle JDeveloper so I agree that I don't think this is a Tomcat issue.  I'm not sure what might be causing this though because I shut down my webserver and restarted it and everything has been working fine since. 

What happens when you restart tomcat?

Scott


On 6/20/07, Fleischer Peter < peter.fleischer@munich-airport.de  <ma...@munich-airport.de> > wrote: 

Hello,

we are developing a quite simple application based on MyFaces, Trinidad and Facelets. After deploying this application to a Tomcat 5.5.23 and using the application for a while we are facing connection errors in Tomcat caused by too many open files.

Checking the running Tomcat process with lsof (list open files) we discovered, that  <application>/WEB-INF/lib/trinidad- impl-1.0.1-incubating-SNAPSHOT.jar was open for about 300 times. The number rises with every request. At some time eventually a garbage collection closes all these files.

I don't think this is a Tomcat error, because this jar is the only jar file opened so many times. Perhaps some Trinidad code fails to close a file? Is this a known issue? 

Many thanks in advance.

Peter Fleischer

_____________________________________________________________

Munich Airport International
Flughafen München GmbH
Peter Fleischer
ITED Competence Center Application Development 
Support Division Information Technology
P. O. Box  23 17 55
85326 München
Phone: +49 89 975-3 24 30
Fax: +49 89 975-3 24 06
<mailto: peter.fleischer@munich-airport.de  <ma...@munich-airport.de> >

Vorsitzender des Aufsichtsrats: - Chairman of the Supervisory Board:
Staatsminister Prof. Dr. Kurt Faltlhauser
Geschäftsführung: - Executive Board:
Dr. Michael Kerkloh, Walter Vill und Peter Trautmann 
Handelsregister: - Commercial Register: RG München, HR-Nr. B 5448
Sitz der Gesellschaft: - Registered Office: München
_____________________________________________________________





Re: [Trinidad] Causing Too many open files error?

Posted by Scott O'Bryan <da...@gmail.com>.
I saw this as well using Oracle JDeveloper so I agree that I don't think
this is a Tomcat issue.  I'm not sure what might be causing this though
because I shut down my webserver and restarted it and everything has been
working fine since.

What happens when you restart tomcat?

Scott

On 6/20/07, Fleischer Peter <pe...@munich-airport.de> wrote:
>
> Hello,
>
> we are developing a quite simple application based on MyFaces, Trinidad
> and Facelets. After deploying this application to a Tomcat 5.5.23 and
> using the application for a while we are facing connection errors in Tomcat
> caused by too many open files.
>
> Checking the running Tomcat process with lsof (list open files) we
> discovered, that  <application>/WEB-INF/lib/trinidad-
> impl-1.0.1-incubating-SNAPSHOT.jar was open for about 300 times. The
> number rises with every request. At some time eventually a garbage
> collection closes all these files.
>
> I don't think this is a Tomcat error, because this jar is the only jar
> file opened so many times. Perhaps some Trinidad code fails to close a file?
> Is this a known issue?
>
> Many thanks in advance.
>
> Peter Fleischer
>
> _____________________________________________________________
>
> Munich Airport International
> Flughafen München GmbH
> Peter Fleischer
> ITED Competence Center Application Development
> Support Division Information Technology
> P. O. Box  23 17 55
> 85326 München
> Phone: +49 89 975-3 24 30
> Fax: +49 89 975-3 24 06
> <ma...@munich-airport.de>
>
> Vorsitzender des Aufsichtsrats: - Chairman of the Supervisory Board:
> Staatsminister Prof. Dr. Kurt Faltlhauser
> Geschäftsführung: - Executive Board:
> Dr. Michael Kerkloh, Walter Vill und Peter Trautmann
> Handelsregister: - Commercial Register: RG München, HR-Nr. B 5448
> Sitz der Gesellschaft: - Registered Office: München
> _____________________________________________________________
>
>