@Override
  public SystemMemoryStatistics getSystemMemoryStatistics() {
    try {
      long memory = getTotalPhysicalMemoryUsageBytes();
      return new SystemMemoryStatistics(memory);
    } catch (Exception e) {
      log.warn("Error when running ps: ", e);
      return null;
    }
  }
A convenience method to execute shell commands and return all lines of their output.

@param cmdArray the command to run
@return all lines of the output.
@throws IOException
samza-core/src/main/java/org/apache/samza/container/host/PosixCommandBasedStatisticsGetter.java