mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

ian.packer
16.59.2015 4d361d4791fd09a9d4bf4929edf74d8ccef3d8b5
opendj-server-legacy/src/main/java/org/opends/server/util/RuntimeInformation.java
@@ -198,9 +198,15 @@
      ObjectName oname = new ObjectName(
          ManagementFactory.OPERATING_SYSTEM_MXBEAN_NAME);
      // Check if this MXBean contains Sun's extension
      if (mbs.isInstanceOf(oname, "com.sun.management.OperatingSystemMXBean")) {
          // Get platform-specific attribute "TotalPhysicalMemorySize"
          return (Long) mbs.getAttribute(oname, "TotalPhysicalMemorySize");
      if (mbs.isInstanceOf(oname, "com.sun.management.OperatingSystemMXBean"))
      {
        // Get platform-specific attribute "TotalPhysicalMemorySize"
        return (Long) mbs.getAttribute(oname, "TotalPhysicalMemorySize");
      }
      else if (mbs.isInstanceOf(oname, "com.ibm.lang.management.OperatingSystemMXBean"))
      {
        // IBM JVM attribute is named differently
        return (Long) mbs.getAttribute(oname, "TotalPhysicalMemory");
      }
    }
    catch (Exception ignored)