Uploaded image for project: 'Cloud Enablement'
  1. Cloud Enablement
  2. CLOUD-2286

Ability to change the garbage collector in Java S2I image

    Details

      Description

      Would be good to allow users to change the garbage collector when using the Java S2I image. Adding a different collector via JAVA_OPTS_APPEND does not take effect.

      Currently the garbage collector is set in this script with no option to change it:
      https://github.com/jboss-openshift/cct_module/blob/1.0/os-java-run/added/java-default-options#L121

      gc_config() {
        local minHeapFreeRatio=${GC_MIN_HEAP_FREE_RATIO:-20}
        local maxHeapFreeRatio=${GC_MAX_HEAP_FREE_RATIO:-40}
        local timeRatio=${GC_TIME_RATIO:-4}
        local adaptiveSizePolicyWeight=${GC_ADAPTIVE_SIZE_POLICY_WEIGHT:-90}
        local maxMetaspaceSize=${GC_MAX_METASPACE_SIZE:-100}
      
        echo "-XX:+UseParallelGC " \
             "-XX:MinHeapFreeRatio=${minHeapFreeRatio} "\
             "-XX:MaxHeapFreeRatio=${maxHeapFreeRatio} "\
             "-XX:GCTimeRatio=${timeRatio} "\
             "-XX:AdaptiveSizePolicyWeight=${adaptiveSizePolicyWeight} "\
             "-XX:MaxMetaspaceSize=${maxMetaspaceSize}m"
      }
      
      error_handling() {
        echo "-XX:+ExitOnOutOfMemoryError"
      }
      
      initialize_container_limits > /dev/null
      
      ## Echo options, trimming trailing and multiple spaces
      echo "$(initial_memory) $(max_memory) $(gc_config) $(diagnostics) $(cpu_core_tunning) $(error_handling)" | awk '$1=$1'
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  jdowland Jonathan Dowland
                  Reporter:
                  trogers-rh Travis Rogers
                  Tester:
                  petr nehyba
                • Votes:
                  1 Vote for this issue
                  Watchers:
                  6 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: