Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-20509

Plan: fix wasted memory in plans with large partition counts

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.0.0
    • Component/s: Query Planning
    • Labels:

      Description

        public void addPathToAlias(Path path, String newAlias){
          ArrayList<String> aliases = pathToAliases.get(path);
          if (aliases == null) {
            aliases = new ArrayList<>();
            StringInternUtils.internUriStringsInPath(path);
            pathToAliases.put(path, aliases);
          }
          aliases.add(newAlias.intern());
        }
      

      ArrayList::DEFAULT_CAPACITY is 10, so this wastes 500 bytes of memory due to the new ArrayList<>();.

        Attachments

        1. HIVE-20509.2.patch
          0.7 kB
          Barnabas Maidics
        2. HIVE-20509.patch
          0.7 kB
          Barnabas Maidics
        3. before.png
          268 kB
          Barnabas Maidics
        4. after.png
          236 kB
          Barnabas Maidics

          Activity

            People

            • Assignee:
              b.maidics Barnabas Maidics
              Reporter:
              gopalv Gopal Vijayaraghavan
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: