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

Ability to change the garbage collector in webserver images with GC_CONTAINER_OPTIONS

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Done
    • Major
    • JWS31 1.2.5.GA , JWS50 1.0.0.GA
    • JWS3
    • None
    • CLOUD Maintenance Sprint 25

    Description

      Cloned from https://issues.jboss.org/browse/CLOUD-2286 , which implements the feature for openjdk and other images by adding the GC_CONTAINER_OPTIONS env:

      Would be good to allow users to change the garbage collector when using the webserver images . 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'
      

      Attachments

        Issue Links

          Activity

            People

              szappis@redhat.com Sokratis Zappis
              rhn-support-trogers Travis Rogers (Inactive)
              Petr Nehyba Petr Nehyba (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: