[ 
https://issues.apache.org/jira/browse/YARN-1856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15047082#comment-15047082
 ] 

Sidharta Seethana commented on YARN-1856:
-----------------------------------------

[~vvasudev] , there is still an issue with the handling of the soft limit 
percentage. Isn't there a divide by 100 missing? 

{code}
    long softLimit =
        (long) (container.getResource().getMemory() * softLimitPerc);
{code}

The test code below needs to be updated too - instead of specifying the value 
of the soft limit percentage here in test code, maybe we should use 
DEFAULT_NM_MEMORY_RESOURCE_CGROUPS_SOFT_LIMIT_PERC ? It also looks like the 
validation of the memory value is not happening correctly below. You could use 
Mockito's {{eq()}} to verify argument values. 

{code}
  verify(mockCGroupsHandler, times(1))
        .updateCGroupParam(CGroupsHandler.CGroupController.MEMORY, id,
            CGroupsHandler.CGROUP_PARAM_MEMORY_SOFT_LIMIT_BYTES,
            String.valueOf((int) (memory * 0.9)) + "M");
{code}

> cgroups based memory monitoring for containers
> ----------------------------------------------
>
>                 Key: YARN-1856
>                 URL: https://issues.apache.org/jira/browse/YARN-1856
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>          Components: nodemanager
>    Affects Versions: 2.3.0
>            Reporter: Karthik Kambatla
>            Assignee: Varun Vasudev
>         Attachments: YARN-1856.001.patch, YARN-1856.002.patch, 
> YARN-1856.003.patch
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to