From 4faed779d1cacedf524cb47711071a5a6ada8809 Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Tue, 15 Jan 2013 06:32:08 -0600 Subject: [PATCH] Detect memory for heap sizing on OSX. Patch by Cathy Daw, reviewed by brandonwilliams for CASSANDRA-5157 --- conf/cassandra-env.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/conf/cassandra-env.sh b/conf/cassandra-env.sh index 95760ddf9a..e38371f204 100644 --- a/conf/cassandra-env.sh +++ b/conf/cassandra-env.sh @@ -30,6 +30,11 @@ calculate_heap_sizes() system_memory_in_mb=`prtconf | awk '/Memory size:/ {print $3}'` system_cpu_cores=`psrinfo | wc -l` ;; + Darwin) + system_memory_in_bytes=`sysctl hw.memsize | awk '{print $2}'` + system_memory_in_mb=`expr $system_memory_in_bytes / 1024 / 1024` + system_cpu_cores=`sysctl hw.ncpu | awk '{print $2}'` + ;; *) # assume reasonable defaults for e.g. a modern desktop or # cheap server