code: static String extractXmxValueStr(String javaChildOptsStr) {
      if (StringUtils.isBlank(javaChildOptsStr)) {
        LOG.info("Null/empty input argument to get xmxValue, returning "
            + Constants.DEFAULT_XMX_SETTING_STR);
        return Constants.DEFAULT_XMX_SETTING_STR;
       }
      // first split based on "-Xmx" in "-Xmx1024m -verbose:gc"
      final String JAVA_XMX_PREFIX = "-Xmx";
      String[] xmxStr = javaChildOptsStr.split(JAVA_XMX_PREFIX);
      if (xmxStr.length >= 2) {
        // xmxStr[0] is ''
        // and XmxStr[1] is "1024m -verbose:gc"
        String[] valuesStr = xmxStr[1].split(" ");
        // split on whitespace
        if (valuesStr.length >= 1) {
          // now valuesStr[0] is "1024m"
          return valuesStr[0];
        } else {
          LOG.info("Strange Xmx setting, returning default " + javaChildOptsStr);
          return Constants.DEFAULT_XMX_SETTING_STR;
        }
      } else {
        // Xmx is not present in java child opts
        LOG.info("Xmx setting absent, returning default " + javaChildOptsStr);
        return Constants.DEFAULT_XMX_SETTING_STR;
      }
    }
docs: extract the string around Xmx in the java child opts " -Xmx1024m -verbose:gc"
  @param javaChildOptsStr
  @return string that represents the Xmx value