title: Linux: How to measure memory usage for a thread within process?
body: <p>I want to measure memory usage for each thread within process. Is it possible? I'm trying to figure out which thread leaks memory.</p>
  
  <p>Edit 1.
  The pmap for leaking process shows ~600 allocation by [ anon ] </p>
  
  <pre><code>...
  63b00000    772K rw---    [ anon ]
  63bc1000    252K -----    [ anon ]
  63c00000    772K rw---    [ anon ]
  63cc1000    252K -----    [ anon ]
  63d00000    772K rw---    [ anon ]
  ...
  </code></pre>
  
  <p>Advice on what to do next?</p>
  
  <p>Edit 2. 
  Only virtual memory is leaking e.g. physical memory usage is stable.</p>