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

Unexpected internal name for Filler array klass causes error in VisualVM

XMLWordPrintable

    • gc
    • 21
    • b03

        I am investigating the following VisualVM bug https://github.com/oracle/visualvm/issues/523 and it looks to me that the name of FillerArray in jmap -histo does not follow the naming convention. Below is the current output from JDK 21:

        jmap -histo 334286
         num #instances #bytes class name (module)
        -------------------------------------------------------
           1: 22613 1141112 [B (java.base@21.0.1)
           2: 21488 515712 java.lang.String (java.base@21.0.1)
           3: 3799 470352 java.lang.Class (java.base@21.0.1)
           4: 290 350480 Ljdk.internal.vm.FillerArray; (java.base@21.0.1)
           5: 4081 312000 [Ljava.lang.Object; (java.base@21.0.1)
           6: 974 177520 [I (java.base@21.0.1)
           7: 5397 172704 java.util.HashMap$Node (java.base@21.0.1)
           8: 4819 154208 java.util.concurrent.ConcurrentHashMap$Node (java.base@21.0.1)
           9: 948 137208 [C (java.base@21.0.1)
          10: 3264 104448 java.util.Hashtable$Entry (java.base@21.0.1)
          11: 116 86200 [J (java.base@21.0.1)
          12: 622 81920 [Ljava.util.HashMap$Node; (java.base@21.0.1)
          13: 2486 79552 javax.swing.text.html.parser.ContentModel (java.desktop@21.0.1)


        I guess that the correct name should be [Ljdk.internal.vm.FillerArray; - currently it is missing the array prefix [. Alternatively if FillerArray should be reported as an instance of a class (not an array) that the name should be jdk.internal.vm.FillerArray like any other class in the output produced by jmap -histo. However if FillerArray is reported as instance of a class, this means (based on the example above) that there are 290 instances of the FillerArray class, which take up 350480 bytes and so one instance is 1208.5517 bytes - which looks really strange to me.

        FYI: I was able to "fix" the FillerArray name with the small naive patch below:

        diff --git a/src/hotspot/share/memory/universe.cpp b/src/hotspot/share/memory/universe.cpp
        index 1c0a5461ffe..1f5c1ab03bd 100644
        --- a/src/hotspot/share/memory/universe.cpp
        +++ b/src/hotspot/share/memory/universe.cpp
        @@ -337,7 +337,7 @@ void Universe::genesis(TRAPS) {
               // Initialization of the fillerArrayKlass must come before regular
               // int-TypeArrayKlass so that the int-Array mirror points to the
               // int-TypeArrayKlass.
        - _fillerArrayKlassObj = TypeArrayKlass::create_klass(T_INT, "Ljdk/internal/vm/FillerArray;", CHECK);
        + _fillerArrayKlassObj = TypeArrayKlass::create_klass(T_INT, "[Ljdk/internal/vm/FillerArray;", CHECK);
               for (int i = T_BOOLEAN; i < T_LONG+1; i++) {
                 _typeArrayKlassObjs[i] = TypeArrayKlass::create_klass((BasicType)i, CHECK);
               }

          There are no Sub-Tasks for this issue.

              tschatzl Thomas Schatzl
              thurka Tomáš Hůrka
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: