On Sat, Feb 14, 2009 at 9:22 AM, Matthew Toseland
<[email protected]> wrote:
> On Friday 13 February 2009 08:46, Daniel Cheng wrote:
>> On Fri, Feb 13, 2009 at 12:17 AM,  <[email protected]> wrote:
>> > Author: toad
>> > Date: 2009-02-12 16:17:43 +0000 (Thu, 12 Feb 2009)
>> > New Revision: 25598
>> >
>> > Modified:
>> >
> branches/db4o/freenet/src/freenet/client/async/ClientRequestSchedulerCore.java
>> >   branches/db4o/freenet/src/freenet/node/Node.java
>> >   branches/db4o/freenet/src/freenet/support/RandomGrabArray.java
>> >   branches/db4o/freenet/src/freenet/support/RemoveRandomWithObject.java
>> >   branches/db4o/freenet/src/freenet/support/SectoredRandomGrabArray.java
>> >
> branches/db4o/freenet/src/freenet/support/SectoredRandomGrabArrayWithObject.java
>> > Log:
>> > Hopefully fix leak
>> >
>> >
>> > Modified:
> branches/db4o/freenet/src/freenet/client/async/ClientRequestSchedulerCore.java
>> > ===================================================================
>> > ---
> branches/db4o/freenet/src/freenet/client/async/ClientRequestSchedulerCore.java
> 2009-02-12 14:35:21 UTC (rev 25597)
>> > +++
> branches/db4o/freenet/src/freenet/client/async/ClientRequestSchedulerCore.java
> 2009-02-12 16:17:43 UTC (rev 25598)
>> > @@ -447,6 +447,8 @@
>> >                        SendableRequest req = (SendableRequest)
> chosenTracker.removeRandom(starter, container, context);
>> >                        if(chosenTracker.isEmpty()) {
>> >
> trackerParent.remove(chosenTracker.getNumber(), container);
>> > +                               if(chosenTracker.persistent())
>> > +
> chosenTracker.removeFrom(container);
>> >                                if(trackerParent.isEmpty()) {
>> >                                        if(logMINOR)
> Logger.minor(this, "Should remove priority");
>> >                                }
>> >
>> > Modified: branches/db4o/freenet/src/freenet/node/Node.java
>> > ===================================================================
>> > --- branches/db4o/freenet/src/freenet/node/Node.java    2009-02-12
> 14:35:21 UTC (rev 25597)
>> > +++ branches/db4o/freenet/src/freenet/node/Node.java    2009-02-12
> 16:17:43 UTC (rev 25598)
>> > @@ -22,6 +22,7 @@
>> >  import java.util.MissingResourceException;
>> >  import java.util.Random;
>> >  import java.util.Set;
>> > +import java.util.TreeMap;
>> >  import java.util.Vector;
>> >
>> >  import org.spaceroots.mantissa.random.MersenneTwister;
>> > @@ -30,6 +31,7 @@
>> >  import com.db4o.Db4o;
>> >  import com.db4o.ObjectContainer;
>> >  import com.db4o.ObjectServer;
>> > +import com.db4o.ObjectSet;
>> >  import com.db4o.config.Configuration;
>> >  import com.db4o.config.QueryEvaluationMode;
>> >  import com.db4o.diagnostic.ClassHasNoFields;
>> > @@ -893,6 +895,25 @@
>> >                db = Db4o.openFile(dbConfig, new
> File(nodeDir, "node.db4o").toString());
>> >
>> >                System.err.println("Opened database");
>> > +
>> > +               // DUMP DATABASE CONTENTS
>> > +               System.err.println("DUMPING DATABASE CONTENTS:");
>> > +               ObjectSet<Object> contents = db.queryByExample(new
> Object());
>> > +               Map<String,Integer> map = new HashMap<String, Integer>();
>> > +               for(Object o : contents) {
>> > +                       String name = o.getClass().getName();
>> > +                       if((map.get(name)) != null) {
>> > +                               map.put(name, map.get(name)+1);
>> > +                       } else {
>> > +                               map.put(name, 1);
>> > +                       }
>> > +               }
>> > +               int total = 0;
>> > +               for(Map.Entry<String,Integer> entry : map.entrySet()) {
>> > +
> System.err.println(entry.getKey()+" : "+entry.getValue());
>> > +                       total += entry.getValue();
>> > +               }
>> > +               System.err.println("END DATABASE DUMP: "+total+"
> objects");
>>
>>
>> [...]
>> java.util.concurrent.Semaphore : 1
>> java.util.concurrent.Semaphore$NonfairSync : 1
>>
>> semaphore is not safe to store in database (it's reference from the
> compressor)
>
> Why not?
>
> This is not from the RealCompressor. It's from the COMPRESSOR_TYPE. It's
> static, so I'm not sure why it's being stored in the database at all...
>

It keep the number of compressor can be run concurrently.
It decrease when a compressor is running.
 (1) if it is stored when compressor is running -> it may be zero, no
more compressor can be run in next start
 (2) this number depends on number of cpu, which may change over node restart
_______________________________________________
Devl mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

Reply via email to