Repository: kafka
Updated Branches:
  refs/heads/0.10.1 ee0ab7dd0 -> b1f8fc7b6


KAFKA-4271: Fix the server start script for Windows 32-bit OS

Without this fix the new consumer fails to run on a 32-bit Windows OS.

Author: Vahid Hashemian <vahidhashem...@us.ibm.com>

Reviewers: Jason Gustafson, Guozhang Wang

Closes #2189 from vahidhashemian/KAFKA-4271

(cherry picked from commit 8d188c9110f7f2a6f9f16f1340d9d254bf583741)
Signed-off-by: Guozhang Wang <wangg...@gmail.com>


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

Branch: refs/heads/0.10.1
Commit: b1f8fc7b6e40f371ebf5617b5f7f8b7ca5693903
Parents: ee0ab7d
Author: Vahid Hashemian <vahidhashem...@us.ibm.com>
Authored: Wed Nov 30 12:19:23 2016 -0800
Committer: Guozhang Wang <wangg...@gmail.com>
Committed: Wed Nov 30 12:19:35 2016 -0800

----------------------------------------------------------------------
 bin/windows/kafka-server-start.bat | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/b1f8fc7b/bin/windows/kafka-server-start.bat
----------------------------------------------------------------------
diff --git a/bin/windows/kafka-server-start.bat 
b/bin/windows/kafka-server-start.bat
index 315507e..1aa859c 100644
--- a/bin/windows/kafka-server-start.bat
+++ b/bin/windows/kafka-server-start.bat
@@ -24,7 +24,15 @@ IF ["%KAFKA_LOG4J_OPTS%"] EQU [""] (
     set 
KAFKA_LOG4J_OPTS=-Dlog4j.configuration=file:%~dp0../../config/log4j.properties
 )
 IF ["%KAFKA_HEAP_OPTS%"] EQU [""] (
-    set KAFKA_HEAP_OPTS=-Xmx1G -Xms1G
+    rem detect OS architecture
+    wmic os get osarchitecture | find /i "32-bit" >nul 2>&1
+    IF NOT ERRORLEVEL 1 (
+        rem 32-bit OS
+        set KAFKA_HEAP_OPTS=-Xmx512M -Xms512M
+    ) ELSE (
+        rem 64-bit OS
+        set KAFKA_HEAP_OPTS=-Xmx1G -Xms1G
+    )
 )
 %~dp0kafka-run-class.bat kafka.Kafka %*
 EndLocal

Reply via email to