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

Print 'rss' and 'cache' as part of the container information

XMLWordPrintable

    • b05

      Container information printed in hs_err files and jcmd VM.info does not contain the 'rss' and 'cache' usage. For a process running in a cgroup based container, it is not just the 'rss' that is accounted towards the total memory usage. The 'cache' usage is also counted towards the memory usage. The OOM killer can terminate a process if its rss+cache usage reaches the max memory limit of the container.

      Often times, users monitor the RSS of processes running in a container, and get confused when a process gets terminated by the OOM killer even when its RSS is much lower than the max memory limit of the container.

      Currently, we print the total memory usage (from /sys/fs/cgroup/memory/memory.usage_in_bytes) in hs_err and VM.info output.

      Example:
      container (cgroup) information:
      container_type: cgroupv1
      cpu_cpuset_cpus: 0-1
      cpu_memory_nodes: 0
      active_processor_count: 2
      cpu_quota: no quota
      cpu_period: 100000
      cpu_shares: no shares
      memory_limit_in_bytes: 524288 k
      memory_and_swap_limit_in_bytes: 1048576 k
      memory_soft_limit_in_bytes: unlimited
      memory_usage_in_bytes: 524164 k. <<------
      memory_max_usage_in_bytes: 524288 k.
      kernel_memory_usage_in_bytes: 3124 k
      kernel_memory_max_usage_in_bytes: unlimited
      kernel_memory_limit_in_bytes: 4272 k
      maximum number of tasks: unlimited
      current number of tasks: 35

      It would be very helpful to print the 'rss' and 'cache' usage as well, which can be obtained from /sys/fs/cgroup/memory/memory.stat file.

            gziemski Gerard Ziemski
            poonam Poonam Bajaj Parhar
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: