Uploaded image for project: 'Apache YuniKorn'
  1. Apache YuniKorn
  2. YUNIKORN-1715 Yunikorn performance improvements
  3. YUNIKORN-1764

Don't copy resource object in Node.preAllocateCheck()

    XMLWordPrintableJSON

Details

    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:

      	// 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)
      

      GetAvailableResource() returns the copy of the underlying resource object. However, cloning is not necessary. Two approaches are possible:

      1. since this code is inside the Node object, we can access sn.availableResource without cloning by simply acquiring the read lock
      2. add a new method which receives a Resource object, then performs the fit-no fit check without copying

      Attachments

        1. screenshot-1.png
          224 kB
          Peter Bacsko

        Issue Links

          Activity

            People

              pbacsko Peter Bacsko
              pbacsko Peter Bacsko
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: