Skip to content

Pass Java_Opts to the Java Command

Krishna Nikhil Vedurumudi requested to merge krveduru/javaOpts into master

Infrastructure Submissions:


  • [YES/NO] Have you added an explanation of what your changes do and why you'd like us to include them?
  • [YES/NO] I have updated the documentation accordingly.
  • [YES/NO/NA] I have added tests to cover my changes.
  • [YES/NO/NA] All new and existing tests passed.
  • [YES/NO/NA] I have formatted the terraform code. (terraform fmt -recursive && go fmt ./...)

Current Behavior or Linked Issues


#126 (closed)

Adding ability to pass JAVA_OPTS for the Docker Containers using which JVM parameters can be configured.

Does this introduce a breaking change?


  • [YES/NO]

Other information


JVM Heap Memory metrics

  • When deployed current change with master branch of Storage service default values for MaxRAMPercentage and InitialRAMPercentage are set. Here, no container limits are set and hence, MAX heap = 25% of available RAM in the NODE and COMMITTED heap = 1.56% of available RAM - Going by JVM defaults.

  • When deployed current change with tomcat branch (custom branch in Storage Service) that contains JAVA_OPTS environment variable we could see that Max and Committed heap values are set accordingly.

        # Memory limited to 2 GB.
        resources:
          requests:
            cpu: "500m"
            memory: "2Gi"
          limits:
            cpu: "1000m"
            memory: "2Gi"

        - name: JAVA_OPTS
          value: "-XX:InitialRAMPercentage=25.0 -XX:MaxRAMPercentage=50.0"

Since Container Memory limit is set to 2GB and Initial RAM = 25%, the COMMITTED heap is ~350MB and the MAX heap is 50% of 2Gi that is ~1G

jvm

Edited by Krishna Nikhil Vedurumudi

Merge request reports