Author: toad
Date: 2009-03-26 15:21:21 +0000 (Thu, 26 Mar 2009)
New Revision: 26203

Modified:
   branches/db4o/freenet/src/freenet/node/Node.java
Log:
Deactivate and GC after dumping, because of collections issues


Modified: branches/db4o/freenet/src/freenet/node/Node.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/Node.java    2009-03-26 15:20:51 UTC 
(rev 26202)
+++ branches/db4o/freenet/src/freenet/node/Node.java    2009-03-26 15:21:21 UTC 
(rev 26203)
@@ -934,12 +934,21 @@
                        } catch (Throwable t) {
                                Logger.minor(this, "CAUGHT "+t+" FOR CLASS 
"+o.getClass());
                        }
+                       db.deactivate(o, 1);
                }
                int total = 0;
                for(Map.Entry<String,Integer> entry : map.entrySet()) {
                        System.err.println(entry.getKey()+" : 
"+entry.getValue());
                        total += entry.getValue();
                }
+               // Some structures e.g. collections are sensitive to the 
activation depth.
+               // If they are activated to depth 1, they are broken, and 
activating them to
+               // depth 2 does NOT un-break them! Hence we need to deactivate 
(above) and
+               // GC here...
+               System.gc();
+               System.runFinalization();
+               System.gc();
+               System.runFinalization();
                System.err.println("END DATABASE DUMP: "+total+" objects");
 
                // Boot ID

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

Reply via email to