[ 
https://issues.apache.org/jira/browse/YUNIKORN-1764?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Peter Bacsko updated YUNIKORN-1764:
-----------------------------------
    Description: 
The method {{Resource.Clone()}} shows up quite often in various heap profiles 
which were captured on busy clusters (see screenshot).

One of the call sites of this method is {{Node.preAllocateCheck()}} which calls 
this method in the scheduling cycle very often:
{noformat}
        // check if resources are available
        available := sn.GetAvailableResource()
        // returns true/false based on if the request fits in what we have 
calculated
        return available.FitInMaxUndef(res)
{noformat}
{{GetAvailableResource()}} returns the copy of the underlying resource object. 
However, cloning is not necessary. Two approaches are possible:
 # since this code is inside the {{Node}} object, we can access 
{{sn.availableResource}} without cloning by simply acquiring the read lock
 # add a new method which receives a {{Resource}} object, then performs the 
fit-no fit check without copying

  was:
The method {{Resource.Clone()}} shows up quite often in various heap profiles 
which were captured on busy clusters (see screenshot).

One of the call sites of this method is {{Node.preAllocateCheck()}} which calls 
this method in the scheduling cycle very often:
{noformat}
        // check if resources are available
        available := sn.GetAvailableResource()
        // returns true/false based on if the request fits in what we have 
calculated
        return available.FitInMaxUndef(res)
{noformat}

However, cloning is not necessary. We can pass "res" to the Node which returns 
a boolean whether the request can fit or not, therefore we avoid memory 
allocations.



> Add new method to object.Node to check if there's enough resource
> -----------------------------------------------------------------
>
>                 Key: YUNIKORN-1764
>                 URL: https://issues.apache.org/jira/browse/YUNIKORN-1764
>             Project: Apache YuniKorn
>          Issue Type: Sub-task
>          Components: core - scheduler
>            Reporter: Peter Bacsko
>            Assignee: Peter Bacsko
>            Priority: Major
>         Attachments: screenshot-1.png
>
>
> The method {{Resource.Clone()}} shows up quite often in various heap profiles 
> which were captured on busy clusters (see screenshot).
> One of the call sites of this method is {{Node.preAllocateCheck()}} which 
> calls this method in the scheduling cycle very often:
> {noformat}
>       // check if resources are available
>       available := sn.GetAvailableResource()
>       // returns true/false based on if the request fits in what we have 
> calculated
>       return available.FitInMaxUndef(res)
> {noformat}
> {{GetAvailableResource()}} returns the copy of the underlying resource 
> object. However, cloning is not necessary. Two approaches are possible:
>  # since this code is inside the {{Node}} object, we can access 
> {{sn.availableResource}} without cloning by simply acquiring the read lock
>  # add a new method which receives a {{Resource}} object, then performs the 
> fit-no fit check without copying



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to