From: Luigi B. <fi...@us...> - 2005-06-22 19:43:04
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xmlrpc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29813/src/org/exist/xmlrpc Modified Files: RpcConnection.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: RpcConnection.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmlrpc/RpcConnection.java,v retrieving revision 1.100 retrieving revision 1.101 diff -C2 -d -r1.100 -r1.101 *** RpcConnection.java 21 Jun 2005 19:18:59 -0000 1.100 --- RpcConnection.java 22 Jun 2005 19:42:55 -0000 1.101 *************** *** 588,592 **** Hashtable result = new Hashtable(); if(doc.getContentLength() > MAX_DOWNLOAD_CHUNK_SIZE) { ! File tempFile = File.createTempFile("eXist", ".xml"); tempFile.deleteOnExit(); LOG.debug("Writing to temporary file: " + tempFile.getName()); --- 588,592 ---- Hashtable result = new Hashtable(); if(doc.getContentLength() > MAX_DOWNLOAD_CHUNK_SIZE) { ! File tempFile = File.createTempFile("eXistRPCC", ".xml"); tempFile.deleteOnExit(); LOG.debug("Writing to temporary file: " + tempFile.getName()); *************** *** 642,645 **** --- 642,646 ---- byte[] data = new byte[remaining]; raf.readFully(data); + raf.close(); return data; } |