title: what does "ru_maxrss" means in getrusage
body: <p>I compiled and run the following c++ code <code>test.cpp</code> on my macOS Sierra.</p>
  
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;iostream&gt;
  #include &lt;sys/resource.h&gt;
  
  using namespace std;
  
  int main() {
      int a = 1;
      struct rusage r_usage;
      getrusage(RUSAGE_SELF, &amp;r_usage);
      cout &lt;&lt; "Memory usage = " &lt;&lt; r_usage.ru_maxrss &lt;&lt; endl;
      int b = 2;
      return 0;
  }
  </code></pre>
  
  <p>Then got:</p>
  
  <pre><code>➜  Desktop git:(master) ✗ ./test
  Memory usage = 663552
  </code></pre>
  
  <p>Then I found the unit of <code>ru_maxrss</code> is <strong>kilobytes</strong> <a href="https://stackoverflow.com/questions/12050913/whats-the-unit-of-ru-maxrss-on-linux">here</a>, so the program used <strong>663552 kilobytes</strong>? But I only just created an integer.</p>
  
  <p>Another question is: does <code>ru_maxrss</code> count <code>int b = 2</code>? or it just counts the memory usage before the line calling <code>ru_maxrss</code>.</p>