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

UDFClassLoader leak in Configuration.CACHE_CLASSES

    XMLWordPrintableJSON

Details

    Description

      If a UDF jar has been registered in a session and a temporary function created from it, when the session is closed its UDFClassLoader is not GC'd as it has been leaked to the session's HiveConf object's cache. Since the ClassLoader is not GC'd, the UDF jar's classes aren't GC'd from Metaspace. This can potentially lead to Metaspace OOM.
      Path to GC root is:

      Class Name                                                                                                                          | Shallow Heap | Retained Heap
      -------------------------------------------------------------------------------------------------------------------------------------------------------------------
      contextClassLoader org.apache.hive.service.server.ThreadWithGarbageCleanup @ 0x7164deb50  HiveServer2-Handler-Pool: Thread-72 Thread|          128 |        79,072
      referent java.util.WeakHashMap$Entry @ 0x7164e67d0                                                                                  |           40 |           824
      '- [6] java.util.WeakHashMap$Entry[16] @ 0x71581aac0                                                                                |           80 |         5,056
         '- table java.util.WeakHashMap @ 0x71580f510                                                                                     |           48 |         6,920
            '- CACHE_CLASSES class org.apache.hadoop.conf.Configuration @ 0x71580f3d8                                                     |           64 |        74,528
      -------------------------------------------------------------------------------------------------------------------------------------------------------------------
      

      Attachments

        Issue Links

          Activity

            People

              klcopp Karen Coppage
              klcopp Karen Coppage
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m