code: public void read() {
      String pid = "-1";
      try {
        pid = getProcessId();
        _pid = pid;
      }
      catch (Exception ignore) {}
  
      File f = new File ("/proc/stat");
      if (! f.exists()) {
        return;
      }
  
      try {
        readSystemProcFile();
        readProcessProcFile(pid);
        readProcessNumOpenFds(pid);
        readProcessStatusFile(pid);
        parseSystemProcFile(_systemData);
        parseProcessProcFile(_processData);
        parseProcessStatusFile(_processStatus);
      }
      catch (Exception ignore) {}
    }
docs: Read and parse data from /proc/stat and /proc/&lt;pid&gt;/stat.
  If this doesn't work for some reason, the values will be -1.