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

Update memory estimation login in TopNHash

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.3.0, 2.0.0
    • Query Processor
    • None

    Description

      HIVE-12084 changes TopNHash to use Runtime.getRuntime().freeMemory() for finding available memory.
      However, it does not give the all the memory it could use, it ignores unallocated memory. This is because the heap size of jvm grows up to max heap size (-Xmx) as per it needs. totalMemory() gives total heap space it has allocated, and freeMemory() is the free memory within that.
      See http://i.stack.imgur.com/GjuwM.png and http://stackoverflow.com/questions/3571203/what-is-the-exact-meaning-of-runtime-getruntime-totalmemory-and-freememory .
      So instead of using Runtime.getRuntime().freeMemory() , I think it should use maxMemory() - totalMemory() + freeMemory()

      Attachments

        1. HIVE-12310.1.patch
          0.9 kB
          Hari Sankar Sivarama Subramaniyan

        Issue Links

          Activity

            People

              hsubramaniyan Hari Sankar Sivarama Subramaniyan
              thejas Thejas Nair
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: