Return-Path: X-Original-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-common-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 0742018BBC for ; Tue, 23 Jun 2015 15:51:02 +0000 (UTC) Received: (qmail 62305 invoked by uid 500); 23 Jun 2015 15:51:01 -0000 Delivered-To: apmail-hadoop-common-issues-archive@hadoop.apache.org Received: (qmail 62244 invoked by uid 500); 23 Jun 2015 15:51:01 -0000 Mailing-List: contact common-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-issues@hadoop.apache.org Delivered-To: mailing list common-issues@hadoop.apache.org Received: (qmail 62231 invoked by uid 99); 23 Jun 2015 15:51:01 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Jun 2015 15:51:01 +0000 Date: Tue, 23 Jun 2015 15:51:01 +0000 (UTC) From: "Sangjin Lee (JIRA)" To: common-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HADOOP-12107) long running apps may have a huge number of StatisticsData instances under FileSystem MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HADOOP-12107?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14597851#comment-14597851 ] Sangjin Lee commented on HADOOP-12107: -------------------------------------- Thanks for pointing that out [~walter.k.su]. I think you're right in that normally one {{Statistics}} instance is created per {{FileSystem}} class. That said, it is possible to create {{Statistics}} instances in other manners simply via invoking the public constructor. > long running apps may have a huge number of StatisticsData instances under FileSystem > ------------------------------------------------------------------------------------- > > Key: HADOOP-12107 > URL: https://issues.apache.org/jira/browse/HADOOP-12107 > Project: Hadoop Common > Issue Type: Bug > Components: fs > Affects Versions: 2.7.0 > Reporter: Sangjin Lee > Assignee: Sangjin Lee > Priority: Minor > Attachments: HADOOP-12107.001.patch, HADOOP-12107.002.patch, HADOOP-12107.003.patch > > > We observed with some of our apps (non-mapreduce apps that use filesystems) that they end up accumulating a huge memory footprint coming from {{FileSystem$Statistics$StatisticsData}} (in the {{allData}} list of {{Statistics}}). > Although the thread reference from {{StatisticsData}} is a weak reference, and thus can get cleared once a thread goes away, the actual {{StatisticsData}} instances in the list won't get cleared until any of these following methods is called on {{Statistics}}: > - {{getBytesRead()}} > - {{getBytesWritten()}} > - {{getReadOps()}} > - {{getLargeReadOps()}} > - {{getWriteOps()}} > - {{toString()}} > It is quite possible to have an application that interacts with a filesystem but does not call any of these methods on the {{Statistics}}. If such an application runs for a long time and has a large amount of thread churn, the memory footprint will grow significantly. > The current workaround is either to limit the thread churn or to invoke these operations occasionally to pare down the memory. However, this is still a deficiency with {{FileSystem$Statistics}} itself in that the memory is controlled only as a side effect of those operations. -- This message was sent by Atlassian JIRA (v6.3.4#6332)