I am trying make multiple requests to a servlet from an app which creates a number of threads. The threads make multiple requests to the servlet. When I use a low number of threads, everything 'appears' to work fine. When the thread count increases, I start getting 'SocketException: Too many files open' errors and then the Weblogic server crashes. Does anyone know what might cause this type of error and what exactly this type of error is? Any help would be greatly appreciated.
Charles Talbott<BR>Sun Certified Java 2 Programmer
Madhav Lakkapragada
Ranch Hand
Joined: Jun 03, 2000
Posts: 5040
posted
0
You might have already done this, but thought of suggesting then the Weblogic server crashes I would capture the exception and search the Weblogic docs for the exception or for a string like "too many threads". I know this seems trivial and obvious, but then thought I will start some conversation here....... regds. - satya
The initial problem with the server turned out to be an unrelated issue and is now operating fine. I discovered that the requests to the servlet are being handled fine. The servlet is sending requests fine. I am pretty sure the problem is in my app. The exception occurs when I try to capture the responses in my app via connection.geInputStream() (where connection is an HttpURLConnection object internal to the run() method). I don't think I am leaving files open. Again, any help is much appreciated.
Madhav Lakkapragada
Ranch Hand
Joined: Jun 03, 2000
Posts: 5040
posted
0
do you suspect any timeout issues? sorry i keep guessing, but I am also trying to gain some knowledge abt these probls. regds. - satya
Charles Talbott
Greenhorn
Joined: Feb 09, 2001
Posts: 12
posted
0
I've discovered that the issue is system related. In Unix, an application process is allowed a finite number of file handles. ulimit -n will display this number. The default is 256 the max I believe is 1024. As the number of threads/requests was increasing, I began to exceed this number, hence the 'too many open files' errors. I suspect there is also a limit for the jre, and I am trying to track this down.