code: private void readProcCpuInfoFile() {
      // This directory needs to be read only once
      if (readCpuInfoFile) {
        return;
      }
      // Read "/proc/cpuinfo" file
      BufferedReader in = null;
      FileReader fReader = null;
      try {
        fReader = new FileReader(procfsCpuFile);
        in = new BufferedReader(fReader);
      } catch (FileNotFoundException f) {
        // shouldn't happen....
        return;
      }
      Matcher mat = null;
      try {
        numProcessors = 0;
        String str = in.readLine();
        while (str != null) {
          mat = PROCESSOR_FORMAT.matcher(str);
          if (mat.find()) {
            numProcessors++;
          }
          mat = FREQUENCY_FORMAT.matcher(str);
          if (mat.find()) {
            cpuFrequency = (long)(Double.parseDouble(mat.group(1)) * 1000); // kHz
          }
          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);
        }
      }
      readCpuInfoFile = true;
    }
docs: Read /proc/cpuinfo, parse and calculate CPU information