Uploaded image for project: 'Artifactory Binary Repository'
  1. Artifactory Binary Repository
  2. RTFACT-18229

Parameterize JVM memory options with environment variables in Artifactory docker images

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Docker Image
    • Labels:
      None

      Description

      The default JAVA_OPTIONS runs `export JAVA_OPTIONS="-server -Xms512m -Xmx2g -Xss256k ...`

       

      When we pass Java system properties to the JVM running Artifactory with EXTRA_JAVA_OPTIONS we get `export JAVA_OPTIONS="-server -Xms512m -Xmx2g -Xss256k ...  -server -Xms48g -Xmx48g -Xss256k -XX:+UseG1GC`.

       

      That means we have two of each option on the command line. It is not officially documented that the last command line options take precedence. However, from the following quick check the second instance of the argument (2G) is what takes precedence:

       

      $ java -version; java -Xmx1G -XX:+PrintFlagsFinal -Xmx2G 2>/dev/null | grep MaxHeapSize

      java version "1.8.0_191"
      Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
      Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)
      uintx MaxHeapSize := 2147483648

       

      Proposed improvement is to parameterize JVM memory options with environment variables:

      1. Move the existing JVM parameters out of artifactory.default
      2. Inject them in the entrypoint.sh

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            valeriyp Valeriy Petrov
            Votes:
            4 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated: