Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id D425B200BBE for ; Fri, 28 Oct 2016 01:23:00 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id D2A9A160B06; Thu, 27 Oct 2016 23:23:00 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 20B85160AF6 for ; Fri, 28 Oct 2016 01:22:59 +0200 (CEST) Received: (qmail 33901 invoked by uid 500); 27 Oct 2016 23:22:59 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 33837 invoked by uid 99); 27 Oct 2016 23:22:59 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Oct 2016 23:22:59 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id F243E2C2A68 for ; Thu, 27 Oct 2016 23:22:58 +0000 (UTC) Date: Thu, 27 Oct 2016 23:22:58 +0000 (UTC) From: "Mingliang Liu (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HDFS-11047) Remove deep copies of FinalizedReplica to alleviate heap consumption on DataNode MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 27 Oct 2016 23:23:01 -0000 [ https://issues.apache.org/jira/browse/HDFS-11047?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Mingliang Liu updated HDFS-11047: --------------------------------- Hadoop Flags: Reviewed Fix Version/s: 3.0.0-alpha2 > Remove deep copies of FinalizedReplica to alleviate heap consumption on DataNode > -------------------------------------------------------------------------------- > > Key: HDFS-11047 > URL: https://issues.apache.org/jira/browse/HDFS-11047 > Project: Hadoop HDFS > Issue Type: Improvement > Components: datanode > Reporter: Xiaobing Zhou > Assignee: Xiaobing Zhou > Fix For: 3.0.0-alpha2 > > Attachments: HDFS-11047.000.patch, HDFS-11047.001.patch, HDFS-11047.002.patch > > > DirectoryScanner does scan by deep copying FinalizedReplica. In a deployment with 500,000+ blocks, we've seen the DN heap usage being accumulated to high peaks very quickly. Deep copies of FinalizedReplica will make DN heap usage even worse if directory scans are scheduled more frequently. This proposes removing unnecessary deep copies since DirectoryScanner#scan already holds lock of dataset. > DirectoryScanner#scan > {code} > try(AutoCloseableLock lock = dataset.acquireDatasetLock()) { > for (Entry entry : diskReport.entrySet()) { > String bpid = entry.getKey(); > ScanInfo[] blockpoolReport = entry.getValue(); > > Stats statsRecord = new Stats(bpid); > stats.put(bpid, statsRecord); > LinkedList diffRecord = new LinkedList(); > diffs.put(bpid, diffRecord); > > statsRecord.totalBlocks = blockpoolReport.length; > List bl = dataset.getFinalizedBlocks(bpid); /* deep copies here*/ > {code} > FsDatasetImpl#getFinalizedBlocks > {code} > public List getFinalizedBlocks(String bpid) { > try (AutoCloseableLock lock = datasetLock.acquire()) { > ArrayList finalized = > new ArrayList(volumeMap.size(bpid)); > for (ReplicaInfo b : volumeMap.replicas(bpid)) { > if (b.getState() == ReplicaState.FINALIZED) { > finalized.add(new ReplicaBuilder(ReplicaState.FINALIZED) > .from(b).build()); /* deep copies here*/ > } > } > return finalized; > } > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org