You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Travis Thompson (JIRA)" <ji...@apache.org> on 2014/09/17 02:40:33 UTC

[jira] [Commented] (HADOOP-11098) [JDK8] MaxDirectMemorySize default changed between JDK7 and 8

    [ https://issues.apache.org/jira/browse/HADOOP-11098?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14136582#comment-14136582 ] 

Travis Thompson commented on HADOOP-11098:
------------------------------------------

Knowing the GUI is served from JMX, I looked into JMX and found this:
{code}
  {
  "beans" : [ {
    ...
    "MemNonHeapMaxM" : -9.536743E-7,
    ...
  },
{code}

which is getting set here:

{code:title=hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/source/JvmMetrics.java}
  private void getMemoryUsage(MetricsRecordBuilder rb) {
    MemoryUsage memNonHeap = memoryMXBean.getNonHeapMemoryUsage();
    MemoryUsage memHeap = memoryMXBean.getHeapMemoryUsage();
    Runtime runtime = Runtime.getRuntime();
    rb.addGauge(MemNonHeapUsedM, memNonHeap.getUsed() / M)
      .addGauge(MemNonHeapCommittedM, memNonHeap.getCommitted() / M)
      .addGauge(MemNonHeapMaxM, memNonHeap.getMax() / M)
      .addGauge(MemHeapUsedM, memHeap.getUsed() / M)
      .addGauge(MemHeapCommittedM, memHeap.getCommitted() / M)
      .addGauge(MemHeapMaxM, memHeap.getMax() / M)
      .addGauge(MemMaxM, runtime.maxMemory() / M);
  }
{code}

According to [this | http://docs.oracle.com/javase/8/docs/api/java/lang/management/MemoryUsage.html#getMax--], getMax() returns -1 if the max is unlimited.
{quote}
public long getMax()
Returns the maximum amount of memory in bytes that can be used for memory management. This method returns -1 if the maximum memory size is undefined.
{quote}
And according to [this | http://docs.oracle.com/cd/E15289_01/doc.40/e15062/optionxx.htm#BABGCFFB], you set the non-heap max with {{-XX:MaxDirectMemorySize}}, but it claims it's unlimited by default.
{quote}
Default Value
The default value is zero, which means the maximum direct memory is unbounded.
{quote}
This is obviously the case in JDK8, but I haven't been able to find any references to the default changing between JDK7 and JDK8 yet.

> [JDK8] MaxDirectMemorySize default changed between JDK7 and 8
> -------------------------------------------------------------
>
>                 Key: HADOOP-11098
>                 URL: https://issues.apache.org/jira/browse/HADOOP-11098
>             Project: Hadoop Common
>          Issue Type: Bug
>            Reporter: Travis Thompson
>
> I noticed this because the NameNode UI shows "Max Non Heap Memory" which after some digging I found correlates to MaxDirectMemorySize.
> JDK7
> {noformat}
> Heap Memory used 16.75 GB of 23 GB Heap Memory. Max Heap Memory is 23.7 GB.
> Non Heap Memory used 57.32 MB of 67.38 MB Commited Non Heap Memory. Max Non Heap Memory is 130 MB. 
> {noformat}
> JDK8
> {noformat}
> Heap Memory used 3.02 GB of 7.65 GB Heap Memory. Max Heap Memory is 23.7 GB.
> Non Heap Memory used 103.12 MB of 104.41 MB Commited Non Heap Memory. Max Non Heap Memory is -1 B. 
> {noformat}
> More information in first comment.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)