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 7309C10F6C for ; Thu, 8 Jan 2015 07:22:33 +0000 (UTC) Received: (qmail 35629 invoked by uid 500); 8 Jan 2015 07:22:34 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 35577 invoked by uid 500); 8 Jan 2015 07:22:34 -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 35565 invoked by uid 99); 8 Jan 2015 07:22:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Jan 2015 07:22:34 +0000 Date: Thu, 8 Jan 2015 07:22:34 +0000 (UTC) From: "JichengSong (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 ] JichengSong updated HDFS-7592: ------------------------------ Labels: BlocksMap leak memory (was: BlocksMap MemoryLeak) > 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 > > 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. > --- src/java/org/apache/hadoop/hdfs/server/namenode/BlocksMap.java (= =E7=89=88=E6=9C=AC 1640066) > +++ src/java/org/apache/hadoop/hdfs/server/namenode/BlocksMap.java (= =E5=B7=A5=E4=BD=9C=E5=89=AF=E6=9C=AC) > @@ -205,6 +205,8 @@ > 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); -- This message was sent by Atlassian JIRA (v6.3.4#6332)