Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8283903

GetContainerCpuLoad does not return the correct result in share mode

XMLWordPrintable

        Run a computationally intensive program in Docker using getProcessCpuTime monitor. After a month of running, getProcessCpuTime returns -1.

        Get the runtime data through redefineclass as follows

        hostTicks=175476155560000000
        totalCPUs=96
        containerCPUs=90


        In the following code
        ```
                       long hostTicks = getHostTotalCpuTicks0();
                        int totalCPUs = getHostOnlineCpuCount0();
                        int containerCPUs = getAvailableProcessors();
                        // scale the total host load to the actual container cpus
                        hostTicks = hostTicks * containerCPUs / totalCPUs;
        ```
        (hostTicks * containerCPUs ) Calculate the overflow


        reproduce bug:
           totalCPUs=96
           docker share model
           Computationally intensive programs that run for sufficient time

              pxie Peng Xie
              pxie Peng Xie
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: