Return-Path: Delivered-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Received: (qmail 77390 invoked from network); 11 Mar 2011 15:12:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 11 Mar 2011 15:12:21 -0000 Received: (qmail 43799 invoked by uid 500); 11 Mar 2011 15:12:21 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 43751 invoked by uid 500); 11 Mar 2011 15:12:21 -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 43617 invoked by uid 99); 11 Mar 2011 15:12:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Mar 2011 15:12:21 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Mar 2011 15:12:20 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 78EAB3A47EB for ; Fri, 11 Mar 2011 15:11:59 +0000 (UTC) Date: Fri, 11 Mar 2011 15:11:59 +0000 (UTC) From: "John George (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: <1236087145.13533.1299856319491.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] Commented: (HDFS-307) Namenode GUI does not show actual memory usage 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/HDFS-307?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13005672#comment-13005672 ] John George commented on HDFS-307: ---------------------------------- On further investigation, I found that the fix that I submitted does the same thing as the code that already exists. In short, this issue does not exist anymore. In the previous code when we used "Runtime.getRuntime()" to calculate, this was an issue. But since we moved to using MXBean, this issue went away. I misunderstood this and thought that "Runtime.getRuntime()" returned information that was different from ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getUsed(). But on further research (which I should have done in the first place) on suggestion from Christian Kunz I realized that it is one and the same and so, this change is not necessary. Attaching an email snippet with the response of my research. >>> Christian, >>> Thanks for your detailed response. The difference between 0.20.x and trunk >>> is what was causing the miscommunication. I kept thinking where the >>> "Runtime" usage came from since it was not in trunk. Now I get it. >>> >>> In short, both "MemoryUsage" and "Runtime" returns the same value as far as >>> Heap memory is concerned. "MemoryUsage" also provides an option for Non-Heap >>> usage. >>> >>> MemoryUsage.getUsed(): The amount of used memory in the returned memory >>> usage is the amount of memory occupied by both live objects and garbage >>> objects that have not been collected, if any. >>> >>> The Runtime class's memory methods returns the total heap memory used by an >>> application. >>> >>> Runtime.totalMemory(): Total amount of memory in Java virtual machine. >>> Runtime.freeMemory(): Amount of memory available for future allocated >>> objects. >>> > Namenode GUI does not show actual memory usage > ---------------------------------------------- > > Key: HDFS-307 > URL: https://issues.apache.org/jira/browse/HDFS-307 > Project: Hadoop HDFS > Issue Type: Improvement > Reporter: Qi Liu > Assignee: John George > Priority: Minor > Attachments: a.patch > > > In the namenode GUI, the showed memory usage is not the actual memory usage. Instead, it is the memory currently allocated to Java (Runtime.totalMemory()). That's why we see most of the time, the memory usage is 100%. This is a concern for operation, since this is the only page we can monitor the memory usage of a name node. Showing 100% makes the wrong impression that there is a memory leak in name node, and the name node needs to be restarted. > The current value should show would be Runtime.totalMemory() - Runtime.freeMemory(). -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira