Samarth Jain created HBASE-18734:
------------------------------------
Summary: Possible memory leak when running mini cluster
Key: HBASE-18734
URL: https://issues.apache.org/jira/browse/HBASE-18734
Project: HBase
Issue Type: Bug
Reporter: Samarth Jain
As part of improving the stability of Phoenix tests, I recently did some
analysis and found that when the mini cluster is not able to close all the
regions properly, or if there is some other cruft left behind by a mini cluster
after it has been shut down, it can result in a memory leak. The region server
adds it's thread to the JVM shut down hook in HRegionServer.
{code}
ShutdownHook.install(conf, fs, this, Thread.currentThread());
{code}
So, even if the region server thread terminates when a mini cluster is shut
down, the terminated thread's object stays around. If there is any remaining
cruft (regions, configuration, etc) enclosed within a region server, GC isn't
able to garbage them away since they are still referred to by this terminated
thread object in the shutdown hook.
A possible/likely fix for this would be to call
ShutdownHookManager.removeShutdownHook(regionServerThread) when the mini
cluster is shut down.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)