Uploaded image for project: 'Hadoop YARN'
  1. Hadoop YARN
  2. YARN-2323

FairShareComparator creates too many Resource objects

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.6.0
    • Component/s: fairscheduler
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      Each call of FairShareComparator creates a new Resource object "one":

      Resource one = Resources.createResource(1);
      

      At the volume of 1000 nodes and 1000 apps, the comparator will be called more than 10 million times per second, thus creating more than 10 million object "one", which is unnecessary.

      Since the object "one" is read-only and is never referenced outside of comparator, we could make it static.

        Attachments

        1. YARN-2323-2.patch
          2 kB
          Hong Zhiguo
        2. YARN-2323.patch
          2 kB
          Hong Zhiguo

          Activity

            People

            • Assignee:
              zhiguohong Hong Zhiguo
              Reporter:
              zhiguohong Hong Zhiguo
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: