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

ObjectSizeCalculator.getEffectiveMemoryLayoutSpecification() does not recognize OpenJDK's HotSpot VM

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b04
    • CPU:
      generic
    • OS:
      generic

      Description

      jdk.nashorn.internal.ir.debug.ObjectSizeCalculator.getEffectiveMemoryLayoutSpecification.getEffectiveMemoryLayoutSpecification() does not recognize OpenJDK's HotSpot VM, see below link for detailed code:

      http://hg.openjdk.java.net/jdk9/jdk9/nashorn/file/e56cd9b5660f/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/debug/ObjectSizeCalculator.java#l397

      It was hard coded as:

          public static MemoryLayoutSpecification getEffectiveMemoryLayoutSpecification() {
              final String vmName = System.getProperty("java.vm.name");
              if (vmName == null || !vmName.startsWith("Java HotSpot(TM) ")) {
                  throw new UnsupportedOperationException(
                          "ObjectSizeCalculator only supported on HotSpot VM");
              }

      But for OpenJDK, value of "java.vm.name" property is "OpenJDK 64-Bit Server VM", not "Java HotSpot(TM)" (which is only valid for Oracle JDK).

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              fyang Fei Yang
              Reporter:
              luchsh Jonathan Lu
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: