hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John George (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HDFS-307) Namenode GUI does not show actual memory usage
Date Fri, 11 Mar 2011 15:11:59 GMT

    [ 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

View raw message