[freenet-cvs] r17467 - trunk/freenet/src/freenet/client/async

toad at freenetproject.org toad at freenetproject.org
Sat Feb 2 14:06:35 UTC 2008


Author: toad
Date: 2008-02-02 14:06:35 +0000 (Sat, 02 Feb 2008)
New Revision: 17467

Modified:
   trunk/freenet/src/freenet/client/async/SingleFileFetcher.java
Log:
SingleFileFetcher: Clear metadata so it can be GC'ed when fetching splitfiles and when fetching multi-level metadata.

Modified: trunk/freenet/src/freenet/client/async/SingleFileFetcher.java
===================================================================
--- trunk/freenet/src/freenet/client/async/SingleFileFetcher.java	2008-02-01 23:06:25 UTC (rev 17466)
+++ trunk/freenet/src/freenet/client/async/SingleFileFetcher.java	2008-02-02 14:06:35 UTC (rev 17467)
@@ -375,6 +375,8 @@
 				// Fetch on a second SingleFileFetcher, like with archives.
 				metadata.setSimpleRedirect();
 				final SingleFileFetcher f = new SingleFileFetcher(this, metadata, new MultiLevelMetadataCallback(), ctx);
+				// Clear our own metadata so it can be garbage collected, it will be replaced by whatever is fetched.
+				this.metadata = null;
 				ctx.ticker.queueTimedJob(new Runnable() {
 					public void run() {
 						f.wrapHandleMetadata(true);
@@ -508,6 +510,10 @@
 				parent.onTransition(this, sf);
 				sf.scheduleOffThread();
 				rcb.onBlockSetFinished(this);
+				// Clear our own metadata, we won't need it any more.
+				// For multi-level metadata etc see above.
+				metadata = null; 
+				
 				// SplitFile will now run.
 				// Then it will return data to rcd.
 				// We are now out of the loop. Yay!




More information about the cvs mailing list