[ https://issues.apache.org/jira/browse/HADOOP-10357?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13920035#comment-13920035 ]
Daryn Sharp commented on HADOOP-10357: -------------------------------------- Haven't had time to look at 1.x code, but are you sure it's a real leak? In the sample code although those temporary objects are going to look like a leak unless/until GC kicks in. Trying calling {{System.gc()}} twice if you want to force a full sweep before printing stats. If this parallels the "real" code, why is {{UGI.loginUserFromKeytabAndReturnUGI}} being invoked on every invocation? You should create it and reuse it. Also, if possible you want to wrap your loop with the doAs, instead of a frequent operation in the loop, because doAs isn't particularly cheap to enter/exit. > Memory Leak in UserGroupInformation.doAs for JDBC Connection to Hive > -------------------------------------------------------------------- > > Key: HADOOP-10357 > URL: https://issues.apache.org/jira/browse/HADOOP-10357 > Project: Hadoop Common > Issue Type: Bug > Components: security > Affects Versions: 1.2.0 > Reporter: Larry McCay > > When using UGI.doAs in order to make a connection there appears to be a > memory leak involving the UGI that is used for the doAs and the UGI held by > TUGIAssumingTransport. > When using this approach to establishing a JDBC connection in an environment > that will serve many users and requests client side eventually runs out of > memory. -- This message was sent by Atlassian JIRA (v6.2#6252)