From: Luigi B. <fi...@us...> - 2005-06-22 19:43:04
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xquery/functions/xmldb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29813/src/org/exist/xquery/functions/xmldb Modified Files: XMLDBStore.java Log Message: 1. Changed all calls to File.createTempFile to have individual prefixes. Prior to this change, most temp files had the prefix 'exist' which made it difficult to trace temp file leakage. 2. Fixed RpcConnection.java to close its RandomAccessFile when getting next chunk. Prior to the fix, the server would run out of file handles (at least on Sun JVM 1.4.2 on Linux) when servicing a large number of large documents. A check in /proc/XXX/fd showed a large number of open file handles to deleted temp files. Index: XMLDBStore.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/functions/xmldb/XMLDBStore.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** XMLDBStore.java 13 Jun 2005 09:17:53 -0000 1.18 --- XMLDBStore.java 22 Jun 2005 19:42:56 -0000 1.19 *************** *** 205,209 **** } else { try { ! File temp = File.createTempFile("exist", ".xml"); temp.deleteOnExit(); OutputStream os = new FileOutputStream(temp); --- 205,210 ---- } else { try { ! File temp = File.createTempFile("existDBS", ".xml"); ! // This is deleted later; is this necessary? temp.deleteOnExit(); OutputStream os = new FileOutputStream(temp); *************** *** 215,218 **** --- 216,220 ---- } is.close(); + os.close(); resource = loadFromFile(collection, temp, docName, binary); temp.delete(); |