diff --git a/CHANGES.txt b/CHANGES.txt index 793a5692e2..8c16c35b62 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 1.2-dev + * enforce 1m min keycache for auto (CASSANDRA-4306) * remove COPP (CASSANDRA-2479) * Track tombstone expiration and compact when tombstone content is higher than a configurable threshold, default 20% (CASSANDRA-3442) @@ -15,7 +16,6 @@ (CASSANDRA-4293) * fix Summary component and caches to use correct partitioner (CASSANDRA-4289) - 1.1.1 * add getsstables command to nodetool (CASSANDRA-4199) * apply parent CF compaction settings to secondary index CFs (CASSANDRA-4280) diff --git a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java index 06344cc82b..7aaf0b2156 100644 --- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java +++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java @@ -417,7 +417,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)