Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Remove fixed young generation heap space of instance #3789

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions heron/executor/src/python/heron_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,11 +610,20 @@ def _get_jvm_instance_options(self, instance_id, component_name, remote_debugger
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:
# For Java 11 and above.
# The Xmx value is 25% of the available memory with a maximum of 25 GB.
# However, where there is 2 GB or less of physical memory,
# the value set is 50% of available memory with a minimum value of 16 MB and a maximum value of 512 MB.
# For Java 8
# The Xmx value is half the available memory with a minimum of 16 MB and a maximum of 512 MB.
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,
Expand All @@ -635,7 +644,7 @@ def _get_jvm_instance_options(self, instance_id, component_name, remote_debugger
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):
Expand Down
2 changes: 1 addition & 1 deletion heron/executor/tests/python/heron_executor_unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def get_expected_healthmgr_command():

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 " \
Expand Down