This is an automated email from the ASF dual-hosted git repository.
nicknezis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-heron.git
The following commit(s) were added to refs/heads/master by this push:
new b12a396 Remove fixed young generation heap space of instance (#3789)
b12a396 is described below
commit b12a3965f4acf1ac3f26c27ae4ead624afe706ce
Author: choi se <[email protected]>
AuthorDate: Mon Mar 21 16:00:22 2022 +0900
Remove fixed young generation heap space of instance (#3789)
---
heron/executor/src/python/heron_executor.py | 8 ++++++--
heron/executor/tests/python/heron_executor_unittest.py | 2 +-
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/heron/executor/src/python/heron_executor.py
b/heron/executor/src/python/heron_executor.py
index 1f060c1..535ccd4 100755
--- a/heron/executor/src/python/heron_executor.py
+++ b/heron/executor/src/python/heron_executor.py
@@ -610,11 +610,15 @@ class HeronExecutor:
java_version.startswith("1.6") or \
java_version.startswith("1.5"):
java_metasize_param = 'PermSize'
+ xmn_param = '-Xmn%dM' % xmn_size
+ if self._get_java_major_version() >= 11:
+ # Remove '-Xmn'
+ xmn_param = None
instance_options = [
'-Xmx%dM' % heap_size_mb,
'-Xms%dM' % heap_size_mb,
- '-Xmn%dM' % xmn_size,
+ xmn_param,
'-XX:Max%s=%dM' % (java_metasize_param, java_metasize_mb),
'-XX:%s=%dM' % (java_metasize_param, java_metasize_mb),
'-XX:ReservedCodeCacheSize=%dM' % code_cache_size_mb,
@@ -635,7 +639,7 @@ class HeronExecutor:
if component_name in self.component_jvm_opts:
instance_options.extend(self.component_jvm_opts[component_name].split())
- return instance_options
+ return list(filter(None, instance_options))
def _get_jvm_instance_arguments(self, instance_id, component_name,
global_task_id,
component_index, remote_debugger_port):
diff --git a/heron/executor/tests/python/heron_executor_unittest.py
b/heron/executor/tests/python/heron_executor_unittest.py
index 94f6f90..4745183 100644
--- a/heron/executor/tests/python/heron_executor_unittest.py
+++ b/heron/executor/tests/python/heron_executor_unittest.py
@@ -146,7 +146,7 @@ class HeronExecutorTest(unittest.TestCase):
def get_expected_instance_command(component_name, instance_id, container_id):
instance_name = "container_%d_%s_%d" % (container_id, component_name,
instance_id)
- return "heron_java_home/bin/java -Xmx320M -Xms320M -Xmn160M
-XX:MaxMetaspaceSize=128M " \
+ return "heron_java_home/bin/java -Xmx320M -Xms320M
-XX:MaxMetaspaceSize=128M " \
"-XX:MetaspaceSize=128M -XX:ReservedCodeCacheSize=64M
-XX:+PrintCommandLineFlags " \
"-Djava.net.preferIPv4Stack=true " \
"-XX:+UseG1GC -XX:+ParallelRefProcEnabled
-XX:+UseStringDeduplication " \