On my linux system I was in the proc directory for tomcat and noticed that for each jsp file that was compiled I was ending up with two file descriptors that were never closed. I made the following change to JspReader and the problem seems to have gone away. I don't know what is causing the jsp files to be "reregistered" multiple times that in turn causes the descriptor leak to appear. Also I am assuming there that err.jspError() always throws an Exception. You could also put the err.jspErrror() call inside the try/catch, but then you would have to check for the type of exception in the catch block. My impression is that it should never lead pushFile() with the reader still open. diff -C5 JspReader.java JspReader.java.new *** JspReader.java 2005-09-23 09:45:24.000000000 -0400 --- JspReader.java.new 2005-11-08 12:04:14.000000000 -0500 *************** *** 513,522 **** --- 513,527 ---- String longName = file; int fileid = registerSourceFile(longName); if (fileid == -1) { + if (reader != null) { + try { + reader.close(); + } catch (Exception any) {} + } err.jspError("jsp.error.file.already.registered", file); } currFileId = fileid;
Makes sense to me: thanks for reporting this and investigating it. Will apply.
Fixed.