Hi There, This read of the file? are you doing it a character at a time (ie via the read() method?)
If so try reading more than one charcter at a time. Ie. public void readFile (String filename) { try { File f = new File(filename); FileReader fr = new FileReader(f); char data[] = new char[4096]; int line = 0, read, i; //loop until all the data is read from the stream while ((read = fr.read(data, 0, 4096)) != -1) { //do somthing with the data read } } catch (Exception e) { e.printStackTrace(); } } This will dramatically improve performance and hopefully stop your problem Thanks Pete -----Original Message----- From: Parsons Technical Services [mailto:[EMAIL PROTECTED] Sent: 10 March 2004 13:06 To: Tomcat Users List Subject: Re: Tomcat 4.1 hangs on File Reading Adam, Sound very similar to a problem I had a couple of days ago. Are you using any loops in your code? Specifically while or do-while or endless for loops. If so try changing them to a for loop with a high count say 10k-100k and see what happens. I had a sort method that under the right conditions would bring down my IDE and hog all the processor. Doug www.parsonstechnical.com ----- Original Message ----- From: "Adam Buglass" <[EMAIL PROTECTED]> To: "Tomcat Users List" <[EMAIL PROTECTED]> Sent: Wednesday, March 10, 2004 7:52 AM Subject: Tomcat 4.1 hangs on File Reading > I've got a website which members can log in and out of > (by way of a form which connects to a JSP). > > I've created a simple method in a Java class to write to > a text format log file to tell me stuff like who they are, > when they logged in etc. > > So far so good. > > I'm now trying to write a JSP to analyse this log but > when I try and access the page, tomcat usually hangs > indefinitely. Occassionally it will display something I jtas ask > for, say, the Strings of IDs. Tomcat will then slow right down > (approximately 4-6x slower) and eventually need restarting. > > I've tried with a smaller test file. > I'm closing the file connection which I open in Java. > There doesn't appear to be anything in the logs, in fact > neither Tomcat nor Apache appear to recognise the page request > at all. > > Any ideas / thoughts / suggestions !? > > Thanks, > Adam. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]