code: private void readProcMemInfoFile(boolean readAgain) {
  
      if (readMemInfoFile && !readAgain) {
        return;
      }
  
      // Read "/proc/memInfo" file
      BufferedReader in = null;
      FileReader fReader = null;
      try {
        fReader = new FileReader(procfsMemFile);
        in = new BufferedReader(fReader);
      } catch (FileNotFoundException f) {
        // shouldn't happen....
        return;
      }
  
      Matcher mat = null;
  
      try {
        String str = in.readLine();
        while (str != null) {
          mat = PROCFS_MEMFILE_FORMAT.matcher(str);
          if (mat.find()) {
            if (mat.group(1).equals(MEMTOTAL_STRING)) {
              ramSize = Long.parseLong(mat.group(2));
            } else if (mat.group(1).equals(SWAPTOTAL_STRING)) {
              swapSize = Long.parseLong(mat.group(2));
            } else if (mat.group(1).equals(MEMFREE_STRING)) {
              ramSizeFree = Long.parseLong(mat.group(2));
            } else if (mat.group(1).equals(SWAPFREE_STRING)) {
              swapSizeFree = Long.parseLong(mat.group(2));
            } else if (mat.group(1).equals(INACTIVE_STRING)) {
              inactiveSize = Long.parseLong(mat.group(2));
            }
          }
          str = in.readLine();
        }
      } catch (IOException io) {
        LOG.warn("Error reading the stream " + io);
      } finally {
        // Close the streams
        try {
          fReader.close();
          try {
            in.close();
          } catch (IOException i) {
            LOG.warn("Error closing the stream " + in);
          }
        } catch (IOException i) {
          LOG.warn("Error closing the stream " + fReader);
        }
      }
  
      readMemInfoFile = true;
    }
docs: Read /proc/meminfo, parse and compute memory information
  @param readAgain if false, read only on the first time