1 Reply Latest reply on Aug 17, 2004 6:22 AM by Tom

    Linux + JBoss 3.2.2 problem with file handles and multiple i

    cassisa Newbie

      Hello, I am having a problem with the number of file handles on a Debian system I am using to run multiple instances of jboss 3.2.2 with my application. I have successfully (as far as i can tell) configured the multiple instance binding file to run three instances of my app for different testing environments. The problem is that the instances do not seem to be releasing their file handles.

      Using the command: lsof |wc -l
      I see the number grow steadily with each web request. Not all resources are released after the request completed and over time the system runs out of file handles requireing a restart of the instances.

      Just a quick look at the lsof output shows that most of the file handles are going to the same jar/sar etc. files over and over.... Any idea on what is causing this problem? I did find a post or two that mentions the /tmp directory etc but my working directories all seem to be in the correct place, i.e. <instance-name>/tmp, <instance-name>/log, <instance-name>work etc... Any ideas?

      On windows 2000 Adv. Server and on Fedora Core 2 I do not see similar problems although I have not been able to deploy on Fedora because of characterset problems. However just starting up default with nothing deployed on Debian shows about 4000 file handles and on Fedora about 130. Windows (using the sysinternals tool) shows about 1000.

      The only other strange thing I am using is the Java Service Wrapper to start and stop the services. I followed the install instruction straight from the JSW site.

      Thank You
      Mike Cassisa

        • 1. Re: Linux + JBoss 3.2.2 problem with file handles and multip
          Tom Newbie

          Maybe too late but...

          Using lsof with wc can be misleading. The repeated files you are seeing are the same files but for each java thread running. The actual filehandles will be shared amongst each thread - so as a _rough_ guide you may want to divide the 4000+ figure by the number of java threads ('ps -e | grep java | wc -l').

          I can't be 100% sure about RH but it's most likely that it is running a kernel with NPTL support. As threads are handled in a completely different way the system will only see JBoss under a single process ID - therefore you will only see each open file once. (and one 'java' process from 'ps -e')

          Another good way to see open file descriptors is to "ls -l /proc/$PID/fd/" where $PID is the process id. (Obviously easier with NPTL where there is only one PID).

          Hope this helps
          Tom.