Repository: kafka
Updated Branches:
  refs/heads/trunk 889da45dd -> 69d3d4aad


KAFKA-5470; Replace -XX:+DisableExplicitGC with 
-XX:+ExplicitGCInvokesConcurrent in kafka-run-class

This is important because Bits.reserveMemory calls System.gc() hoping to free 
native
memory in order to avoid throwing an OutOfMemoryException. This call is 
currently
a no-op due to -XX:+DisableExplicitGC.

It's worth mentioning that -XX:MaxDirectMemorySize can be used to increase the
amount of native memory available for allocation of direct byte buffers.

Author: Ismael Juma <ism...@juma.me.uk>

Reviewers: Apurva Mehta <apu...@confluent.io>, Manikumar Reddy 
<manikumar.re...@gmail.com>, Jason Gustafson <ja...@confluent.io>

Closes #3371 from ijuma/kafka-5470-explicit-gc-invokes-concurrent


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

Branch: refs/heads/trunk
Commit: 69d3d4aad6ce0678f592140501485893b68b20b1
Parents: 889da45
Author: Ismael Juma <ism...@juma.me.uk>
Authored: Wed Aug 9 23:38:57 2017 +0100
Committer: Ismael Juma <ism...@juma.me.uk>
Committed: Wed Aug 9 23:38:57 2017 +0100

----------------------------------------------------------------------
 bin/kafka-run-class.sh          | 2 +-
 bin/windows/kafka-run-class.bat | 2 +-
 docs/upgrade.html               | 2 ++
 3 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/69d3d4aa/bin/kafka-run-class.sh
----------------------------------------------------------------------
diff --git a/bin/kafka-run-class.sh b/bin/kafka-run-class.sh
index fe6aefd..c8c60f8 100755
--- a/bin/kafka-run-class.sh
+++ b/bin/kafka-run-class.sh
@@ -212,7 +212,7 @@ fi
 
 # JVM performance options
 if [ -z "$KAFKA_JVM_PERFORMANCE_OPTS" ]; then
-  KAFKA_JVM_PERFORMANCE_OPTS="-server -XX:+UseG1GC -XX:MaxGCPauseMillis=20 
-XX:InitiatingHeapOccupancyPercent=35 -XX:+DisableExplicitGC 
-Djava.awt.headless=true"
+  KAFKA_JVM_PERFORMANCE_OPTS="-server -XX:+UseG1GC -XX:MaxGCPauseMillis=20 
-XX:InitiatingHeapOccupancyPercent=35 -XX:+ExplicitGCInvokesConcurrent 
-Djava.awt.headless=true"
 fi
 
 

http://git-wip-us.apache.org/repos/asf/kafka/blob/69d3d4aa/bin/windows/kafka-run-class.bat
----------------------------------------------------------------------
diff --git a/bin/windows/kafka-run-class.bat b/bin/windows/kafka-run-class.bat
index 1cf0b31..0cea800 100755
--- a/bin/windows/kafka-run-class.bat
+++ b/bin/windows/kafka-run-class.bat
@@ -168,7 +168,7 @@ IF ["%KAFKA_HEAP_OPTS%"] EQU [""] (
 
 rem JVM performance options
 IF ["%KAFKA_JVM_PERFORMANCE_OPTS%"] EQU [""] (
-       set KAFKA_JVM_PERFORMANCE_OPTS=-server -XX:+UseG1GC 
-XX:MaxGCPauseMillis=20 -XX:InitiatingHeapOccupancyPercent=35 
-XX:+DisableExplicitGC -Djava.awt.headless=true
+       set KAFKA_JVM_PERFORMANCE_OPTS=-server -XX:+UseG1GC 
-XX:MaxGCPauseMillis=20 -XX:InitiatingHeapOccupancyPercent=35 
-XX:ExplicitGCInvokesConcurrent -Djava.awt.headless=true
 )
 
 IF ["%CLASSPATH%"] EQU [""] (

http://git-wip-us.apache.org/repos/asf/kafka/blob/69d3d4aa/docs/upgrade.html
----------------------------------------------------------------------
diff --git a/docs/upgrade.html b/docs/upgrade.html
index bb3274a..d5279f2 100644
--- a/docs/upgrade.html
+++ b/docs/upgrade.html
@@ -58,6 +58,8 @@
         whether there is offline log directory. </li>
     <li>Added KafkaStorageException which is a retriable exception. 
KafkaStorageException will be converted to NotLeaderForPartitionException in 
the response
         if the version of client's FetchRequest or ProducerRequest does not 
support KafkaStorageException. </li>
+    <li>-XX:+DisableExplicitGC was replaced by 
-XX:+ExplicitGCInvokesConcurrent in the default JVM settings. This helps
+        avoid out of memory exceptions during allocation of native memory by 
direct buffers in some cases.</li>
 </ul>
 
 <h5><a id="upgrade_100_new_protocols" href="#upgrade_100_new_protocols">New 
Protocol Versions</a></h5>

Reply via email to