Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8020530

Non heap memory size calculated incorrectly; IllegalArgumentException: committed = N should be < max

    Details

      Backports

        Description

        Rung WebLogic server with 1.8.0 encounters this error:

        Caused by: java.lang.IllegalArgumentException: committed = 86482944 should be < max = 50331648

                at java.lang.management.MemoryUsage.<init>(MemoryUsage.java:162)

                at sun.management.MemoryImpl.getMemoryUsage0(Native Method)

                at sun.management.MemoryImpl.getNonHeapMemoryUsage(MemoryImpl.java:75)

               ... 37 more

        There is a bug in jmm_GetMemoryUsage here -- if a memory region does not define a maximum size, then the total_max is not updated:
              if (u.max_size() == (size_t)-1) {
                has_undefined_max_size = true;
              }
              if (!has_undefined_max_size) {
                total_max += u.max_size();
              }
        But there memory region does define a committed size -- so the committed size is increased and the total_max size is not, and so the committed size ends up larger than the total_max size.

        This occurs at least for the Metaspace region (pool->name() returns Metaspace) Which means, I suppose, that the metaspace region has a bug that it is not returning the maximum size? But also the management code should correctly report the maximum size in this instance as undefined rather than throwing an exception.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  vkempik Vladimir Kempik
                  Reporter:
                  soaks Scott Oaks
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: