 <p>You can use <code>pmap</code> + <code>awk</code>.</p> <p>Most likely, we're interested in the <code>RSS</code> memory which is the 3rd column in the last line of the example <code>pmap</code> output below (82564).</p> <pre><code>$ pmap -x &lt;pid&gt; Address Kbytes RSS Dirty Mode Mapping .... 00007f9caf3e7000 4 4 4 r---- ld-2.17.so 00007f9caf3e8000 8 8 8 rw--- ld-2.17.so 00007fffe8931000 132 12 12 rw--- [ stack ] 00007fffe89fe000 8 8 0 r-x-- [ anon ] ffffffffff600000 4 0 0 r-x-- [ anon ] ---------------- ------ ------ ------ total kB 688584 82564 9592 </code></pre> <p>Awk is then used to extract that value.</p> <pre><code>$ pmap -x &lt;pid&gt; | awk '/total/ { print $4 "K" }' </code></pre> <p>The <code>pmap</code> values are in kilobytes. If we wanted it in megabytes, we could do something like this.</p> <pre><code>$ pmap -x &lt;pid&gt; | awk '/total/ { print $4 / 1024 "M" }' </code></pre>