Uploaded image for project: 'Harmony'
  1. Harmony
  2. HARMONY-5523

[drlvm][gc][lang-management][geronimo] MemoryUsage returns incorrect values

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 5.0M4, 5.0M5
    • None
    • None

    Description

      The following test demonstrates the problem:

      public class Test {
      public static void main(String[] args) throws Exception

      { System.out.println(java.lang.management.ManagementFactory.getMemoryMXBean().getHeapMemoryUsage()); }

      }

      Output on RI:

      $ java Test
      init = 0(0K) used = 162416(158K) committed = 2031616(1984K) max = 66650112(65088K)

      $ java -Xms128M -Xmx256M Test
      init = 134217728(131072K) used = 166480(162K) committed = 133234688(130112K) max = 266403840(260160K)

      Output on Harmony:

      $ java Test
      MemoryUsage: init=16777216used=16777216committed=16777216max=16777216

      $ java -Xms128M -Xmx256M Test
      MemoryUsage: init=134217728used=134217728committed=134217728max=134217728

      Clearly enough, the following problems do exist:

      1. getUsed() method always returns the -Xms value instead of actual used memory amount.
      2. getMax() method returns the -Xms value instead of -Xmx value.
      3. toString() method works incorrectly (output is badly readable).

      This issues causes the Geronimo console to display the used memory information incorrectly.

      Attachments

        1. Harmony-5523-classlib.patch
          0.7 kB
          Vasily Zakharov

        Activity

          People

            Unassigned Unassigned
            vmz Vasily Zakharov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: