[ 
https://issues.apache.org/jira/browse/HDFS-12748?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16875343#comment-16875343
 ] 

Weiwei Yang commented on HDFS-12748:
------------------------------------

Hi [~xkrogen]

Thanks for helping to review this, and sorry about the late response. I got 
pinged internally and users are running into this issue too. Let's work 
together to get this fixed.

Your comments make sense to me, I have fixed both of them in v4 patch except 
the first
{quote}I think rather than having a possibility of a null configuration and 
thus requiring a null check, it would be simpler to just supply a default conf 
object like what is done now.
{quote}
Are you suggesting we should have the null check before calling 
{{DFSUtilClient#getHomeDirectory}}? Why that is simpler?

Thanks

 

> NameNode memory leak when accessing webhdfs GETHOMEDIRECTORY
> ------------------------------------------------------------
>
>                 Key: HDFS-12748
>                 URL: https://issues.apache.org/jira/browse/HDFS-12748
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: hdfs
>    Affects Versions: 2.8.2
>            Reporter: Jiandan Yang 
>            Assignee: Weiwei Yang
>            Priority: Major
>         Attachments: HDFS-12748.001.patch, HDFS-12748.002.patch, 
> HDFS-12748.003.patch, HDFS-12748.004.patch
>
>
> In our production environment, the standby NN often do fullgc, through mat we 
> found the largest object is FileSystem$Cache, which contains 7,844,890 
> DistributedFileSystem.
> By view hierarchy of method FileSystem.get() , I found only 
> NamenodeWebHdfsMethods#get call FileSystem.get(). I don't know why creating 
> different DistributedFileSystem every time instead of get a FileSystem from 
> cache.
> {code:java}
>     case GETHOMEDIRECTORY: {
>       final String js = JsonUtil.toJsonString("Path",
>           FileSystem.get(conf != null ? conf : new Configuration())
>               .getHomeDirectory().toUri().getPath());
>       return Response.ok(js).type(MediaType.APPLICATION_JSON).build();
>     }
> {code}
> When we close FileSystem when GETHOMEDIRECTORY, NN don't do fullgc.
> {code:java}
>     case GETHOMEDIRECTORY: {
>       FileSystem fs = null;
>       try {
>         fs = FileSystem.get(conf != null ? conf : new Configuration());
>         final String js = JsonUtil.toJsonString("Path",
>             fs.getHomeDirectory().toUri().getPath());
>         return Response.ok(js).type(MediaType.APPLICATION_JSON).build();
>       } finally {
>         if (fs != null) {
>           fs.close();
>         }
>       }
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to