private static void getDiskStats(LocalStatisticsImpl stats) {
    InputStreamReader isr = null;
    BufferedReader br = null;
    String line;
    try {
      if (hasDiskStats) {
        // 2.6 kernel
        isr = new InputStreamReader(new FileInputStream("/proc/diskstats"));
      } else {
        // 2.4 kernel
        isr = new InputStreamReader(new FileInputStream("/proc/partitions"));
      }
      br = new BufferedReader(isr);
      long readsCompleted = 0, readsMerged = 0;
      long sectorsRead = 0, timeReading = 0;
      long writesCompleted = 0, writesMerged = 0;
      long sectorsWritten = 0, timeWriting = 0;
      long iosInProgress = 0;
      long timeIosInProgress = 0;
      long ioTime = 0;
      if (!hasDiskStats) {
        br.readLine(); // Discard header info
        br.readLine(); // Discard header info
      }
      while ((line = br.readLine()) != null) {
        tokenizer.setString(line);
        {
          // " 8 1 sdb" on 2.6
          // " 8 1 452145145 sdb" on 2.4
          String tok = tokenizer.nextToken();
          if (tok.length() == 0 || Character.isWhitespace(tok.charAt(0))) {
            // skip over first token since it is whitespace
            tokenizer.nextToken();
          }
          // skip first token it is some number
          tokenizer.nextToken();
          // skip second token it is some number
          tok = tokenizer.nextToken();
          if (!hasDiskStats) {
            // skip third token it is some number
            tok = tokenizer.nextToken();
          }
          // Now tok should be the device name.
          if (Character.isDigit(tok.charAt(tok.length() - 1))) {
            // If the last char is a digit
            // skip this line since it is a partition of a device; not a device.
            continue;
          }
        }
        long tmp_readsCompleted = tokenizer.nextTokenAsLong();
        long tmp_readsMerged = tokenizer.nextTokenAsLong();
        long tmp_sectorsRead = tokenizer.nextTokenAsLong();
        long tmp_timeReading = tokenizer.nextTokenAsLong();
        if (tokenizer.hasMoreTokens()) {
          // If we are on 2.6 then we might only have 4 longs; if so ignore this line
          // Otherwise we should have 11 long tokens.
          long tmp_writesCompleted = tokenizer.nextTokenAsLong();
          long tmp_writesMerged = tokenizer.nextTokenAsLong();
          long tmp_sectorsWritten = tokenizer.nextTokenAsLong();
          long tmp_timeWriting = tokenizer.nextTokenAsLong();
          long tmp_iosInProgress = tokenizer.nextTokenAsLong();
          long tmp_timeIosInProgress = tokenizer.nextTokenAsLong();
          long tmp_ioTime = tokenizer.nextTokenAsLong();
          readsCompleted += tmp_readsCompleted;
          readsMerged += tmp_readsMerged;
          sectorsRead += tmp_sectorsRead;
          timeReading += tmp_timeReading;
          writesCompleted += tmp_writesCompleted;
          writesMerged += tmp_writesMerged;
          sectorsWritten += tmp_sectorsWritten;
          timeWriting += tmp_timeWriting;
          iosInProgress += tmp_iosInProgress;
          timeIosInProgress += tmp_timeIosInProgress;
          ioTime += tmp_ioTime;
        }
      } // while
      final int SECTOR_SIZE = 512;
      stats.setLong(LinuxSystemStats.readsCompletedLONG, readsCompleted);
      stats.setLong(LinuxSystemStats.readsMergedLONG, readsMerged);
      stats.setLong(LinuxSystemStats.bytesReadLONG, sectorsRead * SECTOR_SIZE);
      stats.setLong(LinuxSystemStats.timeReadingLONG, timeReading);
      stats.setLong(LinuxSystemStats.writesCompletedLONG, writesCompleted);
      stats.setLong(LinuxSystemStats.writesMergedLONG, writesMerged);
      stats.setLong(LinuxSystemStats.bytesWrittenLONG, sectorsWritten * SECTOR_SIZE);
      stats.setLong(LinuxSystemStats.timeWritingLONG, timeWriting);
      stats.setLong(LinuxSystemStats.iosInProgressLONG, iosInProgress);
      stats.setLong(LinuxSystemStats.timeIosInProgressLONG, timeIosInProgress);
      stats.setLong(LinuxSystemStats.ioTimeLONG, ioTime);
    } catch (NoSuchElementException | IOException ignore) {
    } finally {
      tokenizer.releaseResources();
      if (br != null) {
        try {
          br.close();
        } catch (IOException ignore) {
        }
      }
      if (isr != null) {
        try {
          isr.close();
        } catch (IOException ignore) {
        }
      }
    }
  }
Returns the available system memory (free + cached).

@param logger the logger
@return the available memory in bytes
geode-core/src/main/java/org/apache/geode/internal/statistics/platform/LinuxProcFsStatistics.java