Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>For Unixes (Linux, Mac OS X, Solaris) you could also use the <code>getrusage()</code> function from the standard library module <code>resource</code>. The resulting object has the attribute <code>ru_maxrss</code>, which gives <em>peak</em> memory usage for the calling process:</p> <pre><code>&gt;&gt;&gt; resource.getrusage(resource.RUSAGE_SELF).ru_maxrss 2656 # peak memory usage (bytes on OS X, kilobytes on Linux) </code></pre> <p>The <a href="http://docs.python.org/library/resource.html#resource-usage" rel="noreferrer">Python docs</a> aren't clear on what the units are exactly, but the <a href="http://developer.apple.com/library/mac/#documentation/darwin/reference/manpages/man2/getrusage.2.html" rel="noreferrer">Mac OS X man page</a> for <code>getrusage(2)</code> describes the units as <em>bytes</em>. The Linux man page isn't clear, but it seems to be equivalent to the information from <code>/proc/self/status</code>, which is in <em>kilobytes</em>.</p> <p>The <code>getrusage()</code> function can also be given <code>resource.RUSAGE_CHILDREN</code> to get the usage for child processes, and (on some systems) <code>resource.RUSAGE_BOTH</code> for total (self and child) process usage.</p> <p><code>resource</code> is a standard library module.</p> <p>If you only care about Linux, you can just check the <code>/proc/self/status</code> file as described in a <a href="https://stackoverflow.com/questions/897941/python-equivalent-of-phps-memory-get-usage">similar question</a>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload