If detected cores is zero, try at least one.

Patch by Andy Cobley, reviewed by brandonwilliams for CASSANDRA-4401
This commit is contained in:
Brandon Williams 2012-07-11 09:27:26 -05:00
parent 346ac03c29
commit a12aa08154
1 changed files with 6 additions and 0 deletions

View File

@ -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