You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@yunikorn.apache.org by "Peter Bacsko (Jira)" <ji...@apache.org> on 2023/05/23 23:44:00 UTC

[jira] [Updated] (YUNIKORN-1764) Don't copy resource object in Node.preAllocateCheck()

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

Peter Bacsko updated YUNIKORN-1764:
-----------------------------------
    Summary: Don't copy resource object in Node.preAllocateCheck()  (was: Add new method to object.Node to check if there's enough resource)

> Don't copy resource object in Node.preAllocateCheck()
> -----------------------------------------------------
>
>                 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: issues-unsubscribe@yunikorn.apache.org
For additional commands, e-mail: issues-help@yunikorn.apache.org