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

CgroupV1 detection code should consider memory.swappiness

    XMLWordPrintable

Details

    • b23

    Backports

      Description

        cgroup v1 system

        Operating System Metrics:
            Provider: cgroupv1
            Effective CPU Count: 8
            CPU Period: 100000us
            CPU Quota: -1
            CPU Shares: -1
            List of Processors, 8 total:
            0 1 2 3 4 5 6 7
            List of Effective Processors: N/A
            List of Memory Nodes, 1 total:
            0
            List of Available Memory Nodes: N/A
            Memory Limit: 50.00M
            Memory Soft Limit: Unlimited
            Memory & Swap Limit: 100.00M
            Maximum Processes Limit: 4194305

        set memory.swappiness to 0,swap space will not be used
        https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt

        Memory & Swap Limit should be 50.00M

        test case:
        cgcreate -g memory:foo1
        cd /sys/fs/cgroup/memory/foo1
        echo 52428800 > memory.limit_in_bytes
        echo 104857600 > memory.memsw.limit_in_bytes
        memory.swappiness default value is 60
        cgexec -g memory:foo1 java -XshowSettings:system -Xms60m -XX:+AlwaysPreTouch -version (success)


        echo 0 > memory.swappiness

        cgexec -g memory:foo1 java -XshowSettings:system -Xms60m -XX:+AlwaysPreTouch -version (killed)


        Attachments

          Issue Links

            Activity

              People

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

                Dates

                  Created:
                  Updated:
                  Resolved: