You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2021/01/14 11:30:17 UTC

[GitHub] [ignite] ivandasch commented on a change in pull request #8660: JVM options to ducktape tests

ivandasch commented on a change in pull request #8660:
URL: https://github.com/apache/ignite/pull/8660#discussion_r557308982



##########
File path: modules/ducktests/tests/ignitetest/services/utils/jvm_utils.py
##########
@@ -0,0 +1,118 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""
+This module contains JVM utilities.
+"""
+
+JVM_PARAMS_GC_CMS = "-XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSIncrementalMode " \
+                    "-XX:ConcGCThreads=$(((`nproc`/4)>1?(`nproc`/4):1)) " \
+                    "-XX:ParallelGCThreads=$(((`nproc`/2)>1?(`nproc`/2):1)) " \
+                    "-XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly " \
+                    "-XX:+CMSParallelRemarkEnabled -XX:+CMSClassUnloadingEnabled"
+
+JVM_PARAMS_GC_G1 = "-XX:+UseG1GC -XX:MaxGCPauseMillis=100 " \
+                   "-XX:ConcGCThreads=$(((`nproc`/3)>1?(`nproc`/3):1)) " \
+                   "-XX:ParallelGCThreads=$(((`nproc`*3/4)>1?(`nproc`*3/4):1)) "
+
+JVM_PARAMS_GENERIC = "-server -da -XX:+DisableExplicitGC -XX:+AggressiveOpts -XX:+AlwaysPreTouch " \
+                     "-XX:+ParallelRefProcEnabled -XX:+DoEscapeAnalysis " \
+                     "-XX:+OptimizeStringConcat -XX:+UseStringDeduplication"
+
+
+def jvm_settings(heap_size="768M", gc_settings=JVM_PARAMS_GC_CMS, generic_params=JVM_PARAMS_GENERIC, gc_dump_path=None,
+                 oom_path=None, **kwargs):
+    """
+    Provides settings string for JVM process.
+    param as_list: Represent JVM params as list.
+    param as_map: Represent JVM params as dict.
+    param merge: JVM Params to merge. Adds new or rewrites default values. Can be dict, list or string.
+    """
+    gc_dump = "-XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=32M " \

Review comment:
       It is not a good idea to use "one liner" construction (`val1 if cond1 else val2`) for multi-line construction.
   simple
   ```
   gd_dump = "
   if gc_dump_path:
      gc_dump_path = '....'
   ```
   is more readable.

##########
File path: modules/ducktests/tests/ignitetest/services/utils/jvm_utils.py
##########
@@ -0,0 +1,118 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""
+This module contains JVM utilities.
+"""
+
+JVM_PARAMS_GC_CMS = "-XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSIncrementalMode " \
+                    "-XX:ConcGCThreads=$(((`nproc`/4)>1?(`nproc`/4):1)) " \
+                    "-XX:ParallelGCThreads=$(((`nproc`/2)>1?(`nproc`/2):1)) " \
+                    "-XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly " \
+                    "-XX:+CMSParallelRemarkEnabled -XX:+CMSClassUnloadingEnabled"
+
+JVM_PARAMS_GC_G1 = "-XX:+UseG1GC -XX:MaxGCPauseMillis=100 " \
+                   "-XX:ConcGCThreads=$(((`nproc`/3)>1?(`nproc`/3):1)) " \
+                   "-XX:ParallelGCThreads=$(((`nproc`*3/4)>1?(`nproc`*3/4):1)) "
+
+JVM_PARAMS_GENERIC = "-server -da -XX:+DisableExplicitGC -XX:+AggressiveOpts -XX:+AlwaysPreTouch " \
+                     "-XX:+ParallelRefProcEnabled -XX:+DoEscapeAnalysis " \
+                     "-XX:+OptimizeStringConcat -XX:+UseStringDeduplication"
+
+
+def jvm_settings(heap_size="768M", gc_settings=JVM_PARAMS_GC_CMS, generic_params=JVM_PARAMS_GENERIC, gc_dump_path=None,
+                 oom_path=None, **kwargs):
+    """
+    Provides settings string for JVM process.
+    param as_list: Represent JVM params as list.
+    param as_map: Represent JVM params as dict.
+    param merge: JVM Params to merge. Adds new or rewrites default values. Can be dict, list or string.

Review comment:
       Not really good name for input param. Merge is a verb, noun is preferrable.

##########
File path: modules/ducktests/tests/ignitetest/services/utils/jvm_utils.py
##########
@@ -0,0 +1,118 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""
+This module contains JVM utilities.
+"""
+
+JVM_PARAMS_GC_CMS = "-XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSIncrementalMode " \
+                    "-XX:ConcGCThreads=$(((`nproc`/4)>1?(`nproc`/4):1)) " \
+                    "-XX:ParallelGCThreads=$(((`nproc`/2)>1?(`nproc`/2):1)) " \
+                    "-XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly " \
+                    "-XX:+CMSParallelRemarkEnabled -XX:+CMSClassUnloadingEnabled"
+
+JVM_PARAMS_GC_G1 = "-XX:+UseG1GC -XX:MaxGCPauseMillis=100 " \
+                   "-XX:ConcGCThreads=$(((`nproc`/3)>1?(`nproc`/3):1)) " \
+                   "-XX:ParallelGCThreads=$(((`nproc`*3/4)>1?(`nproc`*3/4):1)) "
+
+JVM_PARAMS_GENERIC = "-server -da -XX:+DisableExplicitGC -XX:+AggressiveOpts -XX:+AlwaysPreTouch " \
+                     "-XX:+ParallelRefProcEnabled -XX:+DoEscapeAnalysis " \
+                     "-XX:+OptimizeStringConcat -XX:+UseStringDeduplication"
+
+
+def jvm_settings(heap_size="768M", gc_settings=JVM_PARAMS_GC_CMS, generic_params=JVM_PARAMS_GENERIC, gc_dump_path=None,
+                 oom_path=None, **kwargs):
+    """
+    Provides settings string for JVM process.
+    param as_list: Represent JVM params as list.
+    param as_map: Represent JVM params as dict.
+    param merge: JVM Params to merge. Adds new or rewrites default values. Can be dict, list or string.
+    """
+    gc_dump = "-XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=32M " \
+              "-XX:+PrintGCDateStamps -verbose:gc -XX:+PrintGCDetails -Xloggc:" + gc_dump_path \
+        if gc_dump_path else ""
+
+    out_of_mem_dump = "-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=" + oom_path \
+        if oom_path else ""
+
+    as_string = f"-Xmx{heap_size} -Xms{heap_size} {gc_settings} {gc_dump} {out_of_mem_dump} {generic_params}".strip()
+
+    to_merge = kwargs.get("merge")
+
+    if to_merge or kwargs.get("as_map", False):

Review comment:
       `None` is treated as `False`, so `kwargs.get("as_map")` is enough

##########
File path: modules/ducktests/tests/ignitetest/services/utils/jvm_utils.py
##########
@@ -0,0 +1,118 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""
+This module contains JVM utilities.
+"""
+
+JVM_PARAMS_GC_CMS = "-XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSIncrementalMode " \
+                    "-XX:ConcGCThreads=$(((`nproc`/4)>1?(`nproc`/4):1)) " \
+                    "-XX:ParallelGCThreads=$(((`nproc`/2)>1?(`nproc`/2):1)) " \
+                    "-XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly " \
+                    "-XX:+CMSParallelRemarkEnabled -XX:+CMSClassUnloadingEnabled"
+
+JVM_PARAMS_GC_G1 = "-XX:+UseG1GC -XX:MaxGCPauseMillis=100 " \
+                   "-XX:ConcGCThreads=$(((`nproc`/3)>1?(`nproc`/3):1)) " \
+                   "-XX:ParallelGCThreads=$(((`nproc`*3/4)>1?(`nproc`*3/4):1)) "
+
+JVM_PARAMS_GENERIC = "-server -da -XX:+DisableExplicitGC -XX:+AggressiveOpts -XX:+AlwaysPreTouch " \
+                     "-XX:+ParallelRefProcEnabled -XX:+DoEscapeAnalysis " \
+                     "-XX:+OptimizeStringConcat -XX:+UseStringDeduplication"
+
+
+def jvm_settings(heap_size="768M", gc_settings=JVM_PARAMS_GC_CMS, generic_params=JVM_PARAMS_GENERIC, gc_dump_path=None,
+                 oom_path=None, **kwargs):
+    """
+    Provides settings string for JVM process.
+    param as_list: Represent JVM params as list.
+    param as_map: Represent JVM params as dict.
+    param merge: JVM Params to merge. Adds new or rewrites default values. Can be dict, list or string.
+    """
+    gc_dump = "-XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=32M " \
+              "-XX:+PrintGCDateStamps -verbose:gc -XX:+PrintGCDetails -Xloggc:" + gc_dump_path \
+        if gc_dump_path else ""
+
+    out_of_mem_dump = "-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=" + oom_path \
+        if oom_path else ""
+
+    as_string = f"-Xmx{heap_size} -Xms{heap_size} {gc_settings} {gc_dump} {out_of_mem_dump} {generic_params}".strip()
+
+    to_merge = kwargs.get("merge")
+
+    if to_merge or kwargs.get("as_map", False):
+        return jvm_settings_merge(as_string, to_merge if to_merge else {}, **kwargs)
+
+    if kwargs.get("as_list", False):
+        return as_string.split()
+
+    return as_string
+
+
+def jvm_settings_merge(src_settings, additionals, **kwargs):
+    """
+    Merges two JVM settings.
+    :param src_settings: base settings. Can be dict, list or string.
+    :param additionals: params to add to or overwrite in src_settings. Can be dict, list or string.
+    param as_list: If True, represents result as list.
+    param as_map: If True, represents result as dict.
+    :return merged JVM settings. By default as string.
+    """
+    as_map = _to_map(src_settings)

Review comment:
       Not a good idea to name this `as_map`. It clashes with input param, it have different type, than input param.
   code is not readable and easy understandable.

##########
File path: modules/ducktests/tests/ignitetest/services/utils/jvm_utils.py
##########
@@ -0,0 +1,118 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""
+This module contains JVM utilities.
+"""
+
+JVM_PARAMS_GC_CMS = "-XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSIncrementalMode " \
+                    "-XX:ConcGCThreads=$(((`nproc`/4)>1?(`nproc`/4):1)) " \
+                    "-XX:ParallelGCThreads=$(((`nproc`/2)>1?(`nproc`/2):1)) " \
+                    "-XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly " \
+                    "-XX:+CMSParallelRemarkEnabled -XX:+CMSClassUnloadingEnabled"
+
+JVM_PARAMS_GC_G1 = "-XX:+UseG1GC -XX:MaxGCPauseMillis=100 " \
+                   "-XX:ConcGCThreads=$(((`nproc`/3)>1?(`nproc`/3):1)) " \
+                   "-XX:ParallelGCThreads=$(((`nproc`*3/4)>1?(`nproc`*3/4):1)) "
+
+JVM_PARAMS_GENERIC = "-server -da -XX:+DisableExplicitGC -XX:+AggressiveOpts -XX:+AlwaysPreTouch " \
+                     "-XX:+ParallelRefProcEnabled -XX:+DoEscapeAnalysis " \
+                     "-XX:+OptimizeStringConcat -XX:+UseStringDeduplication"
+
+
+def jvm_settings(heap_size="768M", gc_settings=JVM_PARAMS_GC_CMS, generic_params=JVM_PARAMS_GENERIC, gc_dump_path=None,
+                 oom_path=None, **kwargs):
+    """
+    Provides settings string for JVM process.
+    param as_list: Represent JVM params as list.
+    param as_map: Represent JVM params as dict.
+    param merge: JVM Params to merge. Adds new or rewrites default values. Can be dict, list or string.
+    """
+    gc_dump = "-XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=32M " \
+              "-XX:+PrintGCDateStamps -verbose:gc -XX:+PrintGCDetails -Xloggc:" + gc_dump_path \
+        if gc_dump_path else ""
+
+    out_of_mem_dump = "-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=" + oom_path \
+        if oom_path else ""
+
+    as_string = f"-Xmx{heap_size} -Xms{heap_size} {gc_settings} {gc_dump} {out_of_mem_dump} {generic_params}".strip()
+
+    to_merge = kwargs.get("merge")
+
+    if to_merge or kwargs.get("as_map", False):
+        return jvm_settings_merge(as_string, to_merge if to_merge else {}, **kwargs)
+
+    if kwargs.get("as_list", False):
+        return as_string.split()
+
+    return as_string
+
+
+def jvm_settings_merge(src_settings, additionals, **kwargs):
+    """
+    Merges two JVM settings.
+    :param src_settings: base settings. Can be dict, list or string.
+    :param additionals: params to add to or overwrite in src_settings. Can be dict, list or string.
+    param as_list: If True, represents result as list.
+    param as_map: If True, represents result as dict.
+    :return merged JVM settings. By default as string.
+    """
+    as_map = _to_map(src_settings)
+
+    as_map.update(_to_map(additionals))
+
+    _remove_duplicates(as_map)
+
+    if kwargs.get("as_map", False):
+        return as_map
+
+    as_list = [e[0] + '=' + e[1] if len(e) > 0 and e[1] else e[0] for e in as_map.items()]
+
+    if kwargs.get("as_list", False):
+        return as_list
+
+    return ' '.join(as_list)
+
+
+def _to_map(params):
+    """"""
+    if isinstance(params, dict):
+        return params
+
+    if isinstance(params, list):
+        params = iter(params)
+    else:
+        params = str(params).split()
+
+    as_map = {}
+
+    for key_val in [entry.split(sep='=', maxsplit=1) for entry in params]:
+        as_map[str(key_val[0])] = str(key_val[1]) if len(key_val) > 1 else None
+
+    return as_map
+
+
+def _remove_duplicates(params: dict):

Review comment:
       As for me, this function is useless. It's result is non-determenistic. 
   For example
   ```
   >>> a = {"-Xmx":"123", "-xmx":"234", "-xMx":"345"}
   >>>_remove_duplicates(a)
   >>>a
   {'-xMx': '345'}
   ```
   And I suppose that this problem really is not a problem at all :). I can hardly believe, that someone add param
   '-xMx'
   
   

##########
File path: modules/ducktests/tests/ignitetest/services/utils/jvm_utils.py
##########
@@ -0,0 +1,118 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""
+This module contains JVM utilities.
+"""
+
+JVM_PARAMS_GC_CMS = "-XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSIncrementalMode " \
+                    "-XX:ConcGCThreads=$(((`nproc`/4)>1?(`nproc`/4):1)) " \
+                    "-XX:ParallelGCThreads=$(((`nproc`/2)>1?(`nproc`/2):1)) " \
+                    "-XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly " \
+                    "-XX:+CMSParallelRemarkEnabled -XX:+CMSClassUnloadingEnabled"
+
+JVM_PARAMS_GC_G1 = "-XX:+UseG1GC -XX:MaxGCPauseMillis=100 " \
+                   "-XX:ConcGCThreads=$(((`nproc`/3)>1?(`nproc`/3):1)) " \
+                   "-XX:ParallelGCThreads=$(((`nproc`*3/4)>1?(`nproc`*3/4):1)) "
+
+JVM_PARAMS_GENERIC = "-server -da -XX:+DisableExplicitGC -XX:+AggressiveOpts -XX:+AlwaysPreTouch " \
+                     "-XX:+ParallelRefProcEnabled -XX:+DoEscapeAnalysis " \
+                     "-XX:+OptimizeStringConcat -XX:+UseStringDeduplication"
+
+
+def jvm_settings(heap_size="768M", gc_settings=JVM_PARAMS_GC_CMS, generic_params=JVM_PARAMS_GENERIC, gc_dump_path=None,
+                 oom_path=None, **kwargs):
+    """
+    Provides settings string for JVM process.
+    param as_list: Represent JVM params as list.
+    param as_map: Represent JVM params as dict.
+    param merge: JVM Params to merge. Adds new or rewrites default values. Can be dict, list or string.
+    """
+    gc_dump = "-XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=32M " \
+              "-XX:+PrintGCDateStamps -verbose:gc -XX:+PrintGCDetails -Xloggc:" + gc_dump_path \
+        if gc_dump_path else ""
+
+    out_of_mem_dump = "-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=" + oom_path \

Review comment:
       Same as above

##########
File path: modules/ducktests/tests/ignitetest/services/utils/jvm_utils.py
##########
@@ -0,0 +1,118 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""
+This module contains JVM utilities.
+"""
+
+JVM_PARAMS_GC_CMS = "-XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSIncrementalMode " \
+                    "-XX:ConcGCThreads=$(((`nproc`/4)>1?(`nproc`/4):1)) " \
+                    "-XX:ParallelGCThreads=$(((`nproc`/2)>1?(`nproc`/2):1)) " \
+                    "-XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly " \
+                    "-XX:+CMSParallelRemarkEnabled -XX:+CMSClassUnloadingEnabled"
+
+JVM_PARAMS_GC_G1 = "-XX:+UseG1GC -XX:MaxGCPauseMillis=100 " \
+                   "-XX:ConcGCThreads=$(((`nproc`/3)>1?(`nproc`/3):1)) " \
+                   "-XX:ParallelGCThreads=$(((`nproc`*3/4)>1?(`nproc`*3/4):1)) "
+
+JVM_PARAMS_GENERIC = "-server -da -XX:+DisableExplicitGC -XX:+AggressiveOpts -XX:+AlwaysPreTouch " \
+                     "-XX:+ParallelRefProcEnabled -XX:+DoEscapeAnalysis " \
+                     "-XX:+OptimizeStringConcat -XX:+UseStringDeduplication"
+
+
+def jvm_settings(heap_size="768M", gc_settings=JVM_PARAMS_GC_CMS, generic_params=JVM_PARAMS_GENERIC, gc_dump_path=None,
+                 oom_path=None, **kwargs):
+    """
+    Provides settings string for JVM process.
+    param as_list: Represent JVM params as list.
+    param as_map: Represent JVM params as dict.
+    param merge: JVM Params to merge. Adds new or rewrites default values. Can be dict, list or string.
+    """
+    gc_dump = "-XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=32M " \
+              "-XX:+PrintGCDateStamps -verbose:gc -XX:+PrintGCDetails -Xloggc:" + gc_dump_path \
+        if gc_dump_path else ""
+
+    out_of_mem_dump = "-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=" + oom_path \
+        if oom_path else ""
+
+    as_string = f"-Xmx{heap_size} -Xms{heap_size} {gc_settings} {gc_dump} {out_of_mem_dump} {generic_params}".strip()
+
+    to_merge = kwargs.get("merge")
+
+    if to_merge or kwargs.get("as_map", False):
+        return jvm_settings_merge(as_string, to_merge if to_merge else {}, **kwargs)
+
+    if kwargs.get("as_list", False):
+        return as_string.split()
+
+    return as_string
+
+
+def jvm_settings_merge(src_settings, additionals, **kwargs):
+    """
+    Merges two JVM settings.
+    :param src_settings: base settings. Can be dict, list or string.
+    :param additionals: params to add to or overwrite in src_settings. Can be dict, list or string.
+    param as_list: If True, represents result as list.
+    param as_map: If True, represents result as dict.
+    :return merged JVM settings. By default as string.
+    """
+    as_map = _to_map(src_settings)
+
+    as_map.update(_to_map(additionals))
+
+    _remove_duplicates(as_map)
+
+    if kwargs.get("as_map", False):

Review comment:
       There is no need to set default value, `None` is treated like `False`

##########
File path: modules/ducktests/tests/ignitetest/services/utils/jvm_utils.py
##########
@@ -0,0 +1,118 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""
+This module contains JVM utilities.
+"""
+
+JVM_PARAMS_GC_CMS = "-XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSIncrementalMode " \
+                    "-XX:ConcGCThreads=$(((`nproc`/4)>1?(`nproc`/4):1)) " \
+                    "-XX:ParallelGCThreads=$(((`nproc`/2)>1?(`nproc`/2):1)) " \
+                    "-XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly " \
+                    "-XX:+CMSParallelRemarkEnabled -XX:+CMSClassUnloadingEnabled"
+
+JVM_PARAMS_GC_G1 = "-XX:+UseG1GC -XX:MaxGCPauseMillis=100 " \
+                   "-XX:ConcGCThreads=$(((`nproc`/3)>1?(`nproc`/3):1)) " \
+                   "-XX:ParallelGCThreads=$(((`nproc`*3/4)>1?(`nproc`*3/4):1)) "
+
+JVM_PARAMS_GENERIC = "-server -da -XX:+DisableExplicitGC -XX:+AggressiveOpts -XX:+AlwaysPreTouch " \
+                     "-XX:+ParallelRefProcEnabled -XX:+DoEscapeAnalysis " \
+                     "-XX:+OptimizeStringConcat -XX:+UseStringDeduplication"
+
+
+def jvm_settings(heap_size="768M", gc_settings=JVM_PARAMS_GC_CMS, generic_params=JVM_PARAMS_GENERIC, gc_dump_path=None,
+                 oom_path=None, **kwargs):
+    """
+    Provides settings string for JVM process.
+    param as_list: Represent JVM params as list.
+    param as_map: Represent JVM params as dict.
+    param merge: JVM Params to merge. Adds new or rewrites default values. Can be dict, list or string.
+    """
+    gc_dump = "-XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=32M " \
+              "-XX:+PrintGCDateStamps -verbose:gc -XX:+PrintGCDetails -Xloggc:" + gc_dump_path \
+        if gc_dump_path else ""
+
+    out_of_mem_dump = "-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=" + oom_path \
+        if oom_path else ""
+
+    as_string = f"-Xmx{heap_size} -Xms{heap_size} {gc_settings} {gc_dump} {out_of_mem_dump} {generic_params}".strip()
+
+    to_merge = kwargs.get("merge")
+
+    if to_merge or kwargs.get("as_map", False):
+        return jvm_settings_merge(as_string, to_merge if to_merge else {}, **kwargs)
+
+    if kwargs.get("as_list", False):

Review comment:
       same as above

##########
File path: modules/ducktests/tests/ignitetest/services/utils/jvm_utils.py
##########
@@ -0,0 +1,118 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""
+This module contains JVM utilities.
+"""
+
+JVM_PARAMS_GC_CMS = "-XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSIncrementalMode " \
+                    "-XX:ConcGCThreads=$(((`nproc`/4)>1?(`nproc`/4):1)) " \
+                    "-XX:ParallelGCThreads=$(((`nproc`/2)>1?(`nproc`/2):1)) " \
+                    "-XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly " \
+                    "-XX:+CMSParallelRemarkEnabled -XX:+CMSClassUnloadingEnabled"
+
+JVM_PARAMS_GC_G1 = "-XX:+UseG1GC -XX:MaxGCPauseMillis=100 " \
+                   "-XX:ConcGCThreads=$(((`nproc`/3)>1?(`nproc`/3):1)) " \
+                   "-XX:ParallelGCThreads=$(((`nproc`*3/4)>1?(`nproc`*3/4):1)) "
+
+JVM_PARAMS_GENERIC = "-server -da -XX:+DisableExplicitGC -XX:+AggressiveOpts -XX:+AlwaysPreTouch " \
+                     "-XX:+ParallelRefProcEnabled -XX:+DoEscapeAnalysis " \
+                     "-XX:+OptimizeStringConcat -XX:+UseStringDeduplication"
+
+
+def jvm_settings(heap_size="768M", gc_settings=JVM_PARAMS_GC_CMS, generic_params=JVM_PARAMS_GENERIC, gc_dump_path=None,
+                 oom_path=None, **kwargs):
+    """
+    Provides settings string for JVM process.
+    param as_list: Represent JVM params as list.
+    param as_map: Represent JVM params as dict.
+    param merge: JVM Params to merge. Adds new or rewrites default values. Can be dict, list or string.
+    """
+    gc_dump = "-XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=32M " \
+              "-XX:+PrintGCDateStamps -verbose:gc -XX:+PrintGCDetails -Xloggc:" + gc_dump_path \
+        if gc_dump_path else ""
+
+    out_of_mem_dump = "-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=" + oom_path \
+        if oom_path else ""
+
+    as_string = f"-Xmx{heap_size} -Xms{heap_size} {gc_settings} {gc_dump} {out_of_mem_dump} {generic_params}".strip()
+
+    to_merge = kwargs.get("merge")
+
+    if to_merge or kwargs.get("as_map", False):
+        return jvm_settings_merge(as_string, to_merge if to_merge else {}, **kwargs)
+
+    if kwargs.get("as_list", False):
+        return as_string.split()
+
+    return as_string
+
+
+def jvm_settings_merge(src_settings, additionals, **kwargs):
+    """
+    Merges two JVM settings.
+    :param src_settings: base settings. Can be dict, list or string.
+    :param additionals: params to add to or overwrite in src_settings. Can be dict, list or string.
+    param as_list: If True, represents result as list.
+    param as_map: If True, represents result as dict.
+    :return merged JVM settings. By default as string.
+    """
+    as_map = _to_map(src_settings)
+
+    as_map.update(_to_map(additionals))
+
+    _remove_duplicates(as_map)
+
+    if kwargs.get("as_map", False):
+        return as_map
+
+    as_list = [e[0] + '=' + e[1] if len(e) > 0 and e[1] else e[0] for e in as_map.items()]

Review comment:
       ```
   as_list = []
   for param, value in as_map.items():
        if value:
             as_list.append(f"{param}={value}")
        else:
             as_list.append(param)
   ```
   is a way more readable.

##########
File path: modules/ducktests/tests/ignitetest/services/utils/jvm_utils.py
##########
@@ -0,0 +1,118 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""
+This module contains JVM utilities.
+"""
+
+JVM_PARAMS_GC_CMS = "-XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSIncrementalMode " \
+                    "-XX:ConcGCThreads=$(((`nproc`/4)>1?(`nproc`/4):1)) " \
+                    "-XX:ParallelGCThreads=$(((`nproc`/2)>1?(`nproc`/2):1)) " \
+                    "-XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly " \
+                    "-XX:+CMSParallelRemarkEnabled -XX:+CMSClassUnloadingEnabled"
+
+JVM_PARAMS_GC_G1 = "-XX:+UseG1GC -XX:MaxGCPauseMillis=100 " \
+                   "-XX:ConcGCThreads=$(((`nproc`/3)>1?(`nproc`/3):1)) " \
+                   "-XX:ParallelGCThreads=$(((`nproc`*3/4)>1?(`nproc`*3/4):1)) "
+
+JVM_PARAMS_GENERIC = "-server -da -XX:+DisableExplicitGC -XX:+AggressiveOpts -XX:+AlwaysPreTouch " \
+                     "-XX:+ParallelRefProcEnabled -XX:+DoEscapeAnalysis " \
+                     "-XX:+OptimizeStringConcat -XX:+UseStringDeduplication"
+
+
+def jvm_settings(heap_size="768M", gc_settings=JVM_PARAMS_GC_CMS, generic_params=JVM_PARAMS_GENERIC, gc_dump_path=None,
+                 oom_path=None, **kwargs):
+    """
+    Provides settings string for JVM process.
+    param as_list: Represent JVM params as list.
+    param as_map: Represent JVM params as dict.
+    param merge: JVM Params to merge. Adds new or rewrites default values. Can be dict, list or string.
+    """
+    gc_dump = "-XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=32M " \
+              "-XX:+PrintGCDateStamps -verbose:gc -XX:+PrintGCDetails -Xloggc:" + gc_dump_path \
+        if gc_dump_path else ""
+
+    out_of_mem_dump = "-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=" + oom_path \
+        if oom_path else ""
+
+    as_string = f"-Xmx{heap_size} -Xms{heap_size} {gc_settings} {gc_dump} {out_of_mem_dump} {generic_params}".strip()
+
+    to_merge = kwargs.get("merge")
+
+    if to_merge or kwargs.get("as_map", False):
+        return jvm_settings_merge(as_string, to_merge if to_merge else {}, **kwargs)
+
+    if kwargs.get("as_list", False):
+        return as_string.split()
+
+    return as_string
+
+
+def jvm_settings_merge(src_settings, additionals, **kwargs):
+    """
+    Merges two JVM settings.
+    :param src_settings: base settings. Can be dict, list or string.
+    :param additionals: params to add to or overwrite in src_settings. Can be dict, list or string.
+    param as_list: If True, represents result as list.
+    param as_map: If True, represents result as dict.
+    :return merged JVM settings. By default as string.
+    """
+    as_map = _to_map(src_settings)
+
+    as_map.update(_to_map(additionals))
+
+    _remove_duplicates(as_map)
+
+    if kwargs.get("as_map", False):
+        return as_map
+
+    as_list = [e[0] + '=' + e[1] if len(e) > 0 and e[1] else e[0] for e in as_map.items()]
+
+    if kwargs.get("as_list", False):
+        return as_list
+
+    return ' '.join(as_list)
+
+
+def _to_map(params):
+    """"""
+    if isinstance(params, dict):
+        return params
+
+    if isinstance(params, list):
+        params = iter(params)
+    else:
+        params = str(params).split()
+
+    as_map = {}
+
+    for key_val in [entry.split(sep='=', maxsplit=1) for entry in params]:

Review comment:
       ```
   for elem in params:
        param_val = elem.split(sep="=", maxsplit=1)
        as_map[param_val[0]] = param_val[1] if len(param_val) > 1 else None
   ```
   is a way more readable.
   BTW Why you always convert strings to strings?

##########
File path: modules/ducktests/tests/ignitetest/services/utils/jvm_utils.py
##########
@@ -0,0 +1,118 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""
+This module contains JVM utilities.
+"""
+
+JVM_PARAMS_GC_CMS = "-XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSIncrementalMode " \
+                    "-XX:ConcGCThreads=$(((`nproc`/4)>1?(`nproc`/4):1)) " \
+                    "-XX:ParallelGCThreads=$(((`nproc`/2)>1?(`nproc`/2):1)) " \
+                    "-XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly " \
+                    "-XX:+CMSParallelRemarkEnabled -XX:+CMSClassUnloadingEnabled"
+
+JVM_PARAMS_GC_G1 = "-XX:+UseG1GC -XX:MaxGCPauseMillis=100 " \
+                   "-XX:ConcGCThreads=$(((`nproc`/3)>1?(`nproc`/3):1)) " \
+                   "-XX:ParallelGCThreads=$(((`nproc`*3/4)>1?(`nproc`*3/4):1)) "
+
+JVM_PARAMS_GENERIC = "-server -da -XX:+DisableExplicitGC -XX:+AggressiveOpts -XX:+AlwaysPreTouch " \
+                     "-XX:+ParallelRefProcEnabled -XX:+DoEscapeAnalysis " \
+                     "-XX:+OptimizeStringConcat -XX:+UseStringDeduplication"
+
+
+def jvm_settings(heap_size="768M", gc_settings=JVM_PARAMS_GC_CMS, generic_params=JVM_PARAMS_GENERIC, gc_dump_path=None,
+                 oom_path=None, **kwargs):
+    """
+    Provides settings string for JVM process.
+    param as_list: Represent JVM params as list.
+    param as_map: Represent JVM params as dict.
+    param merge: JVM Params to merge. Adds new or rewrites default values. Can be dict, list or string.
+    """
+    gc_dump = "-XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=32M " \
+              "-XX:+PrintGCDateStamps -verbose:gc -XX:+PrintGCDetails -Xloggc:" + gc_dump_path \
+        if gc_dump_path else ""
+
+    out_of_mem_dump = "-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=" + oom_path \
+        if oom_path else ""
+
+    as_string = f"-Xmx{heap_size} -Xms{heap_size} {gc_settings} {gc_dump} {out_of_mem_dump} {generic_params}".strip()
+
+    to_merge = kwargs.get("merge")
+
+    if to_merge or kwargs.get("as_map", False):
+        return jvm_settings_merge(as_string, to_merge if to_merge else {}, **kwargs)
+
+    if kwargs.get("as_list", False):
+        return as_string.split()
+
+    return as_string
+
+
+def jvm_settings_merge(src_settings, additionals, **kwargs):
+    """
+    Merges two JVM settings.
+    :param src_settings: base settings. Can be dict, list or string.
+    :param additionals: params to add to or overwrite in src_settings. Can be dict, list or string.
+    param as_list: If True, represents result as list.
+    param as_map: If True, represents result as dict.
+    :return merged JVM settings. By default as string.
+    """
+    as_map = _to_map(src_settings)
+
+    as_map.update(_to_map(additionals))
+
+    _remove_duplicates(as_map)
+
+    if kwargs.get("as_map", False):
+        return as_map
+
+    as_list = [e[0] + '=' + e[1] if len(e) > 0 and e[1] else e[0] for e in as_map.items()]
+
+    if kwargs.get("as_list", False):

Review comment:
       There is no need to set default value, `None` is treated like `False`

##########
File path: modules/ducktests/tests/ignitetest/services/utils/jvm_utils.py
##########
@@ -0,0 +1,118 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""
+This module contains JVM utilities.
+"""
+
+JVM_PARAMS_GC_CMS = "-XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSIncrementalMode " \
+                    "-XX:ConcGCThreads=$(((`nproc`/4)>1?(`nproc`/4):1)) " \
+                    "-XX:ParallelGCThreads=$(((`nproc`/2)>1?(`nproc`/2):1)) " \
+                    "-XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly " \
+                    "-XX:+CMSParallelRemarkEnabled -XX:+CMSClassUnloadingEnabled"
+
+JVM_PARAMS_GC_G1 = "-XX:+UseG1GC -XX:MaxGCPauseMillis=100 " \
+                   "-XX:ConcGCThreads=$(((`nproc`/3)>1?(`nproc`/3):1)) " \
+                   "-XX:ParallelGCThreads=$(((`nproc`*3/4)>1?(`nproc`*3/4):1)) "
+
+JVM_PARAMS_GENERIC = "-server -da -XX:+DisableExplicitGC -XX:+AggressiveOpts -XX:+AlwaysPreTouch " \
+                     "-XX:+ParallelRefProcEnabled -XX:+DoEscapeAnalysis " \
+                     "-XX:+OptimizeStringConcat -XX:+UseStringDeduplication"
+
+
+def jvm_settings(heap_size="768M", gc_settings=JVM_PARAMS_GC_CMS, generic_params=JVM_PARAMS_GENERIC, gc_dump_path=None,

Review comment:
       Not a good name for function. Function name must tell about what it actually do.

##########
File path: modules/ducktests/tests/ignitetest/services/utils/jvm_utils.py
##########
@@ -0,0 +1,118 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""
+This module contains JVM utilities.
+"""
+
+JVM_PARAMS_GC_CMS = "-XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSIncrementalMode " \
+                    "-XX:ConcGCThreads=$(((`nproc`/4)>1?(`nproc`/4):1)) " \
+                    "-XX:ParallelGCThreads=$(((`nproc`/2)>1?(`nproc`/2):1)) " \
+                    "-XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly " \
+                    "-XX:+CMSParallelRemarkEnabled -XX:+CMSClassUnloadingEnabled"
+
+JVM_PARAMS_GC_G1 = "-XX:+UseG1GC -XX:MaxGCPauseMillis=100 " \
+                   "-XX:ConcGCThreads=$(((`nproc`/3)>1?(`nproc`/3):1)) " \
+                   "-XX:ParallelGCThreads=$(((`nproc`*3/4)>1?(`nproc`*3/4):1)) "
+
+JVM_PARAMS_GENERIC = "-server -da -XX:+DisableExplicitGC -XX:+AggressiveOpts -XX:+AlwaysPreTouch " \
+                     "-XX:+ParallelRefProcEnabled -XX:+DoEscapeAnalysis " \
+                     "-XX:+OptimizeStringConcat -XX:+UseStringDeduplication"
+
+
+def jvm_settings(heap_size="768M", gc_settings=JVM_PARAMS_GC_CMS, generic_params=JVM_PARAMS_GENERIC, gc_dump_path=None,
+                 oom_path=None, **kwargs):
+    """
+    Provides settings string for JVM process.
+    param as_list: Represent JVM params as list.
+    param as_map: Represent JVM params as dict.
+    param merge: JVM Params to merge. Adds new or rewrites default values. Can be dict, list or string.
+    """
+    gc_dump = "-XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=32M " \
+              "-XX:+PrintGCDateStamps -verbose:gc -XX:+PrintGCDetails -Xloggc:" + gc_dump_path \
+        if gc_dump_path else ""
+
+    out_of_mem_dump = "-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=" + oom_path \
+        if oom_path else ""
+
+    as_string = f"-Xmx{heap_size} -Xms{heap_size} {gc_settings} {gc_dump} {out_of_mem_dump} {generic_params}".strip()
+
+    to_merge = kwargs.get("merge")
+
+    if to_merge or kwargs.get("as_map", False):
+        return jvm_settings_merge(as_string, to_merge if to_merge else {}, **kwargs)
+
+    if kwargs.get("as_list", False):
+        return as_string.split()
+
+    return as_string
+
+
+def jvm_settings_merge(src_settings, additionals, **kwargs):
+    """
+    Merges two JVM settings.
+    :param src_settings: base settings. Can be dict, list or string.
+    :param additionals: params to add to or overwrite in src_settings. Can be dict, list or string.
+    param as_list: If True, represents result as list.
+    param as_map: If True, represents result as dict.
+    :return merged JVM settings. By default as string.
+    """
+    as_map = _to_map(src_settings)
+
+    as_map.update(_to_map(additionals))
+
+    _remove_duplicates(as_map)
+
+    if kwargs.get("as_map", False):
+        return as_map
+
+    as_list = [e[0] + '=' + e[1] if len(e) > 0 and e[1] else e[0] for e in as_map.items()]
+
+    if kwargs.get("as_list", False):
+        return as_list
+
+    return ' '.join(as_list)
+
+
+def _to_map(params):
+    """"""
+    if isinstance(params, dict):
+        return params
+
+    if isinstance(params, list):
+        params = iter(params)

Review comment:
       list is already iterable




----------------------------------------------------------------
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.

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