Return-Path: X-Original-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B67E3174E1 for ; Tue, 10 Mar 2015 03:54:41 +0000 (UTC) Received: (qmail 82917 invoked by uid 500); 10 Mar 2015 03:54:38 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 82863 invoked by uid 500); 10 Mar 2015 03:54:38 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-issues@hadoop.apache.org Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 82851 invoked by uid 99); 10 Mar 2015 03:54:38 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Mar 2015 03:54:38 +0000 Date: Tue, 10 Mar 2015 03:54:38 +0000 (UTC) From: "Allen Wittenauer (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HDFS-7592) A bug in BlocksMap that cause NameNode memory leak. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HDFS-7592?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:all-tabpanel ] Allen Wittenauer updated HDFS-7592: ----------------------------------- Fix Version/s: (was: 0.21.0) > A bug in BlocksMap that cause NameNode memory leak. > ----------------------------------------------------- > > Key: HDFS-7592 > URL: https://issues.apache.org/jira/browse/HDFS-7592 > Project: Hadoop HDFS > Issue Type: Bug > Components: namenode > Affects Versions: 0.21.0 > Environment: HDFS-0.21.0 > Reporter: JichengSong > Assignee: JichengSong > Labels: BlocksMap, leak, memory > Attachments: HDFS-7592.patch > > > In our HDFS production environment, NameNode FGC frequently after running= for 2 months, we have to restart NameNode manually. > We dumped NameNode's Heap for objects statistics. > Before restarting NameNode: > num #instances #bytes class name > ---------------------------------------------- > =C2=A0=C2=A0=C2=A0 1: 59262275 3613989480 [Ljava.lang.Object; > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ... > =C2=A0=C2=A0 10: 8549361 615553992 org.apache.hadoop.hdfs.server.nam= enode.BlockInfoUnderConstruction > =C2=A0=C2=A0 11: 5941511 427788792 org.apache.hadoop.hdfs.server.nam= enode.INodeFileUnderConstruction > After restarting NameNode: > num #instances #bytes class name > ---------------------------------------------- > =C2=A0=C2=A0=C2=A0 1: 44188391 2934099616 [Ljava.lang.Object; > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ... > =C2=A0=C2=A0 23: 721763 51966936 org.apache.hadoop.hdfs.server.namen= ode.BlockInfoUnderConstruction > =C2=A0=C2=A0 24: 620028 44642016 org.apache.hadoop.hdfs.server.namen= ode.INodeFileUnderConstruction > We find the number of BlockInfoUnderConstruction is abnormally large befo= re restarting NameNode. > As we know, BlockInfoUnderConstruction keeps block state when the file is= being written. But the write pressure of > our cluster is far less than million/sec. We think there is a memory leak= in NameNode. > We fixed the bug as followsing patch. > diff --git a/hdfs/src/java/org/apache/hadoop/hdfs/server/namenode/BlocksM= ap.java b/hdfs/src/java/org/apache/hadoop/hdfs/server/namenode/BlocksMap.ja= va > index 7a40522..857d340 100644 > --- a/hdfs/src/java/org/apache/hadoop/hdfs/server/namenode/BlocksMap.java > +++ b/hdfs/src/java/org/apache/hadoop/hdfs/server/namenode/BlocksMap.java > @@ -205,6 +205,8 @@ class BlocksMap { > DatanodeDescriptor dn =3D currentBlock.getDatanode(idx); > dn.replaceBlock(currentBlock, newBlock); > } > + // change to fix bug about memory leak of NameNode > + map.remove(newBlock); > // replace block in the map itself > map.put(newBlock, newBlock); > return newBlock; -- This message was sent by Atlassian JIRA (v6.3.4#6332)