From a12aa08154faaae7e096d8a6f500d1b352ef94b8 Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Wed, 11 Jul 2012 09:27:26 -0500 Subject: [PATCH] If detected cores is zero, try at least one. Patch by Andy Cobley, reviewed by brandonwilliams for CASSANDRA-4401 --- conf/cassandra-env.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/conf/cassandra-env.sh b/conf/cassandra-env.sh index a3ca022a7b..cef0efbdf1 100644 --- a/conf/cassandra-env.sh +++ b/conf/cassandra-env.sh @@ -41,6 +41,12 @@ calculate_heap_sizes() ;; esac + # some systems like the raspberry pi don't report cores, use at least 1 + if [ "$system_cpu_cores" -lt "1" ] + then + system_cpu_cores="1" + fi + # set max heap size based on the following # max(min(1/2 ram, 1024MB), min(1/4 ram, 8GB)) # calculate 1/2 ram and cap to 1024MB