You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Karen Coppage (Jira)" <ji...@apache.org> on 2021/03/08 14:48:00 UTC

[jira] [Created] (HIVE-24858) UDFClassLoader leak in session HiveConf

Karen Coppage created HIVE-24858:
------------------------------------

             Summary: UDFClassLoader leak in session HiveConf
                 Key: HIVE-24858
                 URL: https://issues.apache.org/jira/browse/HIVE-24858
             Project: Hive
          Issue Type: Bug
            Reporter: Karen Coppage
            Assignee: Karen Coppage


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:
{code:java}
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
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)