Details

    • Type: Improvement
    • Status: Resolved (View workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.5.0
    • Component/s: None
    • Labels:

      Description

      Modify CommandBox to not set a max or min heap size if none is provided by the user.

      Also allow heap size to have the k, m, or g identifier.

      {
        "jvm" : {
          "heapSize" : "2G"
        }
      }
      

      Default if no letter is provided will still be "m"

      Original ticket


      Per the thread of CFML slack referencing this article:

      https://medium.com/@yortuc/jvm-memory-allocation-in-docker-container-a26bbce3a3f2

      Commandbox specifies a default heapSize of 512 in /src/cfml/system/services/ServerService.cfc:127. In a Docker deployment, it appears that the best practice is not to specify a heap size at all. But it's probably not a good idea to just remove this value for everyone, so perhaps a transitional argument and environment variable that, when set, removes any default values for heapSize?

      It could be simplified further, depending on how prescriptive you want to be, by directly adding the relevant JVM arguments, e.g. if

      CFML_JVM_DOCKERHEAPMODE = 1

      then no default heapSize, and the follow JVM args get added:

      -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:MaxRAMFraction=1
      

      This is the first time I've plumbed into the Commandbox source and it looks pretty straightforward, but I'm not quite comfortable enough yet to deal with optional settings that could come from either the command line or the environment (and not sure if that's Commandbox proper or just the Docker stuff).

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                bradwood Brad Wood
                Reporter:
                Aquitaine Samuel W. Knowlton
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: