Author: toad
Date: 2009-03-12 00:18:43 +0000 (Thu, 12 Mar 2009)
New Revision: 26004

Modified:
   branches/db4o/freenet/src/freenet/support/io/SegmentedBucketChainBucket.java
Log:
Run the first iteration blocking, so if we are on the database thread we add 
the restart job before committing. Since we only remove one segment at a time 
we should be fine re memory. This should fix the leak of 
freenet.support.io.SegmentedBucketChainBucket$1 when removing a 400M insert at 
11%.


Modified: 
branches/db4o/freenet/src/freenet/support/io/SegmentedBucketChainBucket.java
===================================================================
--- 
branches/db4o/freenet/src/freenet/support/io/SegmentedBucketChainBucket.java    
    2009-03-12 00:17:33 UTC (rev 26003)
+++ 
branches/db4o/freenet/src/freenet/support/io/SegmentedBucketChainBucket.java    
    2009-03-12 00:18:43 UTC (rev 26004)
@@ -84,6 +84,7 @@
                                        synchronized(this) {
                                                if(!segments.isEmpty()) {
                                                        dbJobRunner.queue(this, 
NativeThread.HIGH_PRIORITY, true);
+                                                       
dbJobRunner.queueRestartJob(this, NativeThread.HIGH_PRIORITY, container, false);
                                                        container.store(this);
                                                        return;
                                                }
@@ -100,7 +101,7 @@
                        
                };
                
-               dbJobRunner.queue(freeJob, NativeThread.HIGH_PRIORITY, true);
+               dbJobRunner.runBlocking(freeJob, NativeThread.HIGH_PRIORITY);
        }
 
        public InputStream getInputStream() throws IOException {
@@ -457,7 +458,8 @@
                                        segment.clear(container);
                                        synchronized(this) {
                                                if(!segments.isEmpty()) {
-                                                       dbJobRunner.queue(this, 
NativeThread.HIGH_PRIORITY, true);
+                                                       dbJobRunner.queue(this, 
NativeThread.HIGH_PRIORITY-1, true);
+                                                       
dbJobRunner.queueRestartJob(this, NativeThread.HIGH_PRIORITY-1, container, 
false);
                                                        
container.store(segments);
                                                        
container.store(SegmentedBucketChainBucket.this);
                                                        return;
@@ -474,7 +476,7 @@
                        }
 
                };
-               dbJobRunner.queue(clearJob, NativeThread.HIGH_PRIORITY-1, true);
+               dbJobRunner.runBlocking(clearJob, NativeThread.HIGH_PRIORITY-1);
        }
 
        /**

_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs

Reply via email to