Author: nextgens
Date: 2008-05-05 13:09:48 +0000 (Mon, 05 May 2008)
New Revision: 19761
Modified:
trunk/freenet/src/freenet/support/io/PersistentTempBucketFactory.java
Log:
Leave the HashSet to the GC as we don't need it anymore and it can be big
Modified: trunk/freenet/src/freenet/support/io/PersistentTempBucketFactory.java
===================================================================
--- trunk/freenet/src/freenet/support/io/PersistentTempBucketFactory.java
2008-05-05 13:06:20 UTC (rev 19760)
+++ trunk/freenet/src/freenet/support/io/PersistentTempBucketFactory.java
2008-05-05 13:09:48 UTC (rev 19761)
@@ -9,7 +9,6 @@
import java.util.Iterator;
import java.util.LinkedList;
-import freenet.crypt.RandomSource;
import freenet.support.Logger;
import freenet.support.api.Bucket;
import freenet.support.api.BucketFactory;
@@ -78,6 +77,8 @@
public void register(File file) {
synchronized(this) {
+ if(originalFiles == null)
+ throw new IllegalStateException("completed Init
has already been called!");
file = FileUtil.getCanonicalFile(file);
if(!originalFiles.remove(file))
Logger.error(this, "Preserving "+file+" but it
wasn't found!", new Exception("error"));
@@ -96,6 +97,7 @@
Logger.minor(this, "Deleting old tempfile "+f);
f.delete();
}
+ originalFiles = null;
}
private Bucket makeRawBucket(long size) throws IOException {