cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbros...@apache.org
Subject [3/3] git commit: enforce 1m min keycache for auto patch by dbrosius reviewed by slebresne for CASSANDRA-4306
Date Tue, 05 Jun 2012 12:54:28 GMT
enforce 1m min keycache for auto
patch by dbrosius reviewed by slebresne for CASSANDRA-4306


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/90ce0257
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/90ce0257
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/90ce0257

Branch: refs/heads/trunk
Commit: 90ce0257827a93cbdfab893c21bd0b5b31c02ec8
Parents: 55d4dd6
Author: Dave Brosius <dbrosius@apache.org>
Authored: Tue Jun 5 08:40:44 2012 -0400
Committer: Dave Brosius <dbrosius@apache.org>
Committed: Tue Jun 5 08:40:44 2012 -0400

----------------------------------------------------------------------
 .../cassandra/config/DatabaseDescriptor.java       |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/90ce0257/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
index 291bc2e..3bafb72 100644
--- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
+++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
@@ -421,7 +421,7 @@ public class DatabaseDescriptor
             {
                 // if key_cache_size_in_mb option was set to "auto" then size of the cache
should be "min(5% of Heap (in MB), 100MB)
                 keyCacheSizeInMB = (conf.key_cache_size_in_mb == null)
-                                    ? Math.min((int) (Runtime.getRuntime().totalMemory()
* 0.05 / 1024 / 1024), 100)
+                                    ? Math.min(Math.max(1, (int) (Runtime.getRuntime().totalMemory()
* 0.05 / 1024 / 1024)), 100)
                                     : conf.key_cache_size_in_mb;
 
                 if (keyCacheSizeInMB < 0)


Mime
View raw message