cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject cvs commit: xml-cocoon2/src/org/apache/cocoon/components/store MRUMemoryStore.java
Date Sat, 25 Aug 2001 03:37:27 GMT
vgritsenko    01/08/24 20:37:27

  Modified:    src/org/apache/cocoon/components/store MRUMemoryStore.java
  Log:
  Patch from Gerhard Froehlich [g-froehlich@gmx.de]
  
  Revision  Changes    Path
  1.16      +13 -9     xml-cocoon2/src/org/apache/cocoon/components/store/MRUMemoryStore.java
  
  Index: MRUMemoryStore.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/store/MRUMemoryStore.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- MRUMemoryStore.java	2001/08/24 00:33:10	1.15
  +++ MRUMemoryStore.java	2001/08/25 03:37:27	1.16
  @@ -208,22 +208,23 @@
         while (true) {
           // amount of memory used is greater then heapsize
           if (this.jvm.totalMemory() - this.jvm.freeMemory() > this.heapsize) {
  -          getLogger().debug(
  -	    "Invoking garbage collection, total memory = " +
  -	    this.jvm.totalMemory() + ", free memory = " + this.jvm.freeMemory()
  -	  );
  +          getLogger().debug("Invoking garbage collection, total memory = "
  +              + this.jvm.totalMemory() + ", free memory = " 
  +              + this.jvm.freeMemory());
             this.jvm.runFinalization();
             this.jvm.gc();
  -          getLogger().debug(
  -	    "Garbage collection complete, total memory = " +
  -	    this.jvm.totalMemory() + ", free memory = " + this.jvm.freeMemory()
  -	  );
  +          getLogger().debug("Garbage collection complete, total memory = "
  +              + this.jvm.totalMemory() + ", free memory = "
  +              + this.jvm.freeMemory());
  +          getLogger().debug("Store size BEFORE cleanup=" + this.cache.size());
             synchronized (this) {
               while ((this.cache.size() > 0) && (this.jvm.freeMemory() < this.freememory))
{
                 this.free();
               }
             }
  +          getLogger().debug("Store size AFTER cleanup=" + this.cache.size());
           }
  +
           try {
             Thread.currentThread().sleep(this.cleanupthreadinterval * 1000);
           } catch (InterruptedException ignore) {}
  @@ -241,6 +242,7 @@
               getLogger().error("Error in writer thread",ex);
             }
           }
  +
           synchronized (this.writer) {
             try {
               writer.wait();
  @@ -339,7 +341,9 @@
       getLogger().debug("Removing object from store");
       this.cache.remove(key);
       this.mrulist.remove(key);
  -    this.fsstore.remove(getFileName(key.toString()));
  +    if(this.filesystem) {
  +      this.fsstore.remove(getFileName(key.toString()));
  +    }
     }
   
     /**
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message