jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r696672 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/CacheManager.java
Date Thu, 18 Sep 2008 15:15:46 GMT
Author: thomasm
Date: Thu Sep 18 08:15:45 2008
New Revision: 696672

URL: http://svn.apache.org/viewvc?rev=696672&view=rev
Log:
JCR-1742 CacheManager resizeAll is slow

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/CacheManager.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/CacheManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/CacheManager.java?rev=696672&r1=696671&r2=696672&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/CacheManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/CacheManager.java
Thu Sep 18 08:15:45 2008
@@ -132,7 +132,9 @@
      * Re-calcualte the maximum memory for each cache, and set the new limits.
      */
     private void resizeAll() {
-        log.debug("resizeAll size=" + caches.size());
+        if (log.isDebugEnabled()) {
+            log.debug("resizeAll size=" + caches.size());
+        }
         // get strong references
         // entries in a weak hash map may disappear any time
         // so can't use size() / keySet() directly
@@ -201,9 +203,11 @@
         for (int i = 0; i < infos.length; i++) {
             CacheInfo info = infos[i];
             Cache cache = info.getCache();
-            log.debug(cache + " now:" + cache.getMaxMemorySize() + " used:"
-                    + info.getMemoryUsed() + " access:" + info.getAccessCount()
-                    + " new:" + info.getMemory());
+            if (log.isDebugEnabled()) {
+                log.debug(cache + " now:" + cache.getMaxMemorySize() + " used:"
+                        + info.getMemoryUsed() + " access:" + info.getAccessCount()
+                        + " new:" + info.getMemory());
+            }
             cache.setMaxMemorySize(info.getMemory());
         }
     }



Mime
View raw message