FAQ
Author: ecapriolo
Date: Wed Jun 20 18:41:16 2012
New Revision: 1352260

URL: http://svn.apache.org/viewvc?rev=1352260&view=rev
Log:
HIVE-3009 Memory leak in TUGIContainingTransport (Ashutosh Chauhan via egc)

Modified:
hive/trunk/shims/src/common/java/org/apache/hadoop/hive/thrift/TUGIContainingTransport.java

Modified: hive/trunk/shims/src/common/java/org/apache/hadoop/hive/thrift/TUGIContainingTransport.java
URL: http://svn.apache.org/viewvc/hive/trunk/shims/src/common/java/org/apache/hadoop/hive/thrift/TUGIContainingTransport.java?rev=1352260&r1=1352259&r2=1352260&view=diff
==============================================================================
--- hive/trunk/shims/src/common/java/org/apache/hadoop/hive/thrift/TUGIContainingTransport.java (original)
+++ hive/trunk/shims/src/common/java/org/apache/hadoop/hive/thrift/TUGIContainingTransport.java Wed Jun 20 18:41:16 2012
@@ -36,7 +36,7 @@ public class TUGIContainingTransport ext

private UserGroupInformation ugi;

- public TUGIContainingTransport(TTransport wrapped, UserGroupInformation ugi) {
+ public TUGIContainingTransport(TTransport wrapped) {
super(wrapped);
}

@@ -65,9 +65,10 @@ public class TUGIContainingTransport ext

public static class Factory extends TTransportFactory {

- // Need a concurrent weak hashmap.
+ // Need a concurrent weakhashmap. WeakKeys() so that when underlying transport gets out of
+ // scope, it still can be GC'ed. Since value of map has a ref to key, need weekValues as well.
private static final ConcurrentMap<TTransport, TUGIContainingTransport> transMap =
- new MapMaker().weakKeys().makeMap();
+ new MapMaker().weakKeys().weakValues().makeMap();

/**
* Get a new <code>TUGIContainingTransport</code> instance, or reuse the
@@ -81,8 +82,8 @@ public class TUGIContainingTransport ext

// UGI information is not available at connection setup time, it will be set later
// via set_ugi() rpc.
- transMap.putIfAbsent(trans, new TUGIContainingTransport(trans,null));
+ transMap.putIfAbsent(trans, new TUGIContainingTransport(trans));
return transMap.get(trans);
}
}
-}
\ No newline at end of file
+}

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcommits @
categorieshive, hadoop
postedJun 20, '12 at 6:41p
activeJun 20, '12 at 6:41p
posts1
users1
websitehive.apache.org

1 user in discussion

Ecapriolo: 1 post

People

Translate

site design / logo © 2021 Grokbase