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

memory leak in directsql for mysql+bonecp specific initialization

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.13.0
    • Fix Version/s: 1.3.0, 2.0.2, 2.1.2, 2.2.0
    • Component/s: Metastore
    • Labels:
      None

      Description

      We observed HMS memory leak when directsql is enabled for MySQL metastore DB.

      The affected code is in the method MetaStoreDirecdtSql.executeNoResult():

      ((Connection)jdoConn.getNativeConnection()).createStatement().execute(queryText);

      The statement object (from createStatement()) is unfortunately referenced in the Connection object. Although close() is called on the Connection object in finally block, the BoneCP just moves it to a freeConnection list. Hence, statement object never get chances to be closed.

      The leaked statement object is not huge (~1KB as observed in memory analyzer). However long running Hive Metastore Server is very likely ended up with bad performance doing frequent garbage collection.

        Attachments

        1. HIVE-15551.patch
          1 kB
          Sergey Shelukhin
        2. HIVE-15551.patch.txt
          1 kB
          Xiaomin Zhang

          Activity

            People

            • Assignee:
              ximz Xiaomin Zhang
              Reporter:
              ximz Xiaomin Zhang
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: