frederiko commented on code in PR #2120:
URL: https://github.com/apache/zookeeper/pull/2120#discussion_r1471433341


##########
bin/zkEnv.sh:
##########
@@ -144,9 +144,15 @@ fi
 
 #echo "CLASSPATH=$CLASSPATH"
 
-# default heap for zookeeper server
-ZK_SERVER_HEAP="${ZK_SERVER_HEAP:-1000}"
-export SERVER_JVMFLAGS="-Xmx${ZK_SERVER_HEAP}m $SERVER_JVMFLAGS"
+# ZK_SERVER_MAXRAMPERCENTAGE has higher precedence over ZK_SERVER_HEAP 
+if [ "x$ZK_SERVER_MAXRAMPERCENTAGE" = "x" ]
+then
+  # default heap for zookeeper server
+  ZK_SERVER_HEAP="${ZK_SERVER_HEAP:-1000}"
+  export SERVER_JVMFLAGS="-Xmx${ZK_SERVER_HEAP}m $SERVER_JVMFLAGS"
+else
+  export SERVER_JVMFLAGS="-XX:MaxRAMPercentage=$ZK_SERVER_MAXRAMPERCENTAGE 
$SERVER_JVMFLAGS"
+fi

Review Comment:
   That makes sense, but how to handle users who are already using 
ZK_SERVER_HEAP to a value other than 1000? Wouldn't they be forced to change to 
include -Xmx as part of the SERVER_JVMFLAGS as of now? My concern was that it 
things are set for them for a long time (by the way of ZK_SERVER_HEAP), 
suddenly they will be setting their heap back to the default value. How should 
we handle that?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@zookeeper.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to