RFR: 8170888: [linux] Experimental support for cgroup memory limits in container (ie Docker) environments
Karen Kinnear
karen.kinnear at oracle.com
Mon Dec 12 16:00:21 UTC 2016
Ship it.
thank you David,
Karen
> On Dec 12, 2016, at 3:37 AM, David Holmes <david.holmes at oracle.com> wrote:
>
> Thanks Kim!
>
> Just need Karen to re-affirm.
>
> David
>
> On 12/12/2016 5:41 PM, Kim Barrett wrote:
>>> On Dec 10, 2016, at 5:14 PM, David Holmes <david.holmes at oracle.com> wrote:
>>>
>>> Updated webrev at:
>>>
>>> http://cr.openjdk.java.net/~dholmes/8170888/webrev.v2/
>>>
>>> Now checks fscanf ret code. Plus fixed 'else' formatting.
>>>
>>> Thanks,
>>> David
>>> -----
>>>
>>> + int ret = fscanf(fp, JULONG_FORMAT, &cgroup_max);
>>> + if (ret == 1 && cgroup_max > 0) {
>>> + // If unlimited, cgroup_max will be a very large, but unspecified
>>> + // value, so use initial phys_mem as a limit
>>> + log_info(gc, heap)("Setting phys_mem to the min of cgroup limit ("
>>> + JULONG_FORMAT "MB) and initial phys_mem ("
>>> + JULONG_FORMAT "MB)", cgroup_max/M, phys_mem/M);
>>> + phys_mem = MIN2(cgroup_max, phys_mem);
>>> + } else {
>>> + warning("Unable to read/parse cgroup memory limit from %s: %s",
>>> + lim_file, errno != 0 ? strerror(errno) : "unknown error");
>>> + }
>>>
>>
>> Looks good.
>>
More information about the hotspot-dev
mailing list