[ https://issues.apache.org/jira/browse/HIVE-8914?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14221314#comment-14221314 ]
shanyu zhao commented on HIVE-8914: ----------------------------------- [~ekoifman] We are using a local variable fs inside the while loop, so at the end of while loop the local variable can be garbage collected. When the process is running low in memory, it will run garbage collection that eventually close the file system. This solves the problem when fs is declared outside of the while loop so that fs can never get garbage collected. Does it make sense? > HDFSCleanup thread holds reference to FileSystem > ------------------------------------------------ > > Key: HIVE-8914 > URL: https://issues.apache.org/jira/browse/HIVE-8914 > Project: Hive > Issue Type: Bug > Components: WebHCat > Affects Versions: 0.13.1 > Reporter: shanyu zhao > Assignee: shanyu zhao > Attachments: HIVE-8914.patch > > > WebHCat server has a long running cleanup thread (HDFSCleanup) which holds a > reference to FileSystem. Because of this reference, many FileSystem related > objects (e.g. MetricsSystemImpl) cannot be garbage collected. Sometimes this > causes OOM exception. Since the cleanup is done every 12 hours by default, we > can simply recreate a FileSystem when we need to use it. -- This message was sent by Atlassian JIRA (v6.3.4#6332)