code: public static int convertStringToMemorySizeInt(String memSize) {
          int result = 0;
          if (memSize.endsWith("K")) {
              result = Integer.valueOf(StringUtils.remove(memSize, 'K')) * 1000;
          } else if (memSize.endsWith("M")) {
              result = Integer.valueOf(StringUtils.remove(memSize, 'M')) * 1000 * 1000;
          } else if (memSize.endsWith("G")) {
              result = Integer.valueOf(StringUtils.remove(memSize, 'G')) * 1000 * 1000 * 1000;
          }
          return result;
      }
docs: Converts a string denoting an amount of bytes into an integer value. Strings are expected to follow this form where # equals a digit: #M The following are permitted for denoting binary size: K = kilobytes, M = megabytes, G = gigabytes
  
  @param memSize
  memory
  @return size as an integer