title: How to find out the memory usage of particular function in a process (C Program) in linux?
body: <pre><code>I would like to find out the memory consumed by particular function in linux.   
  </code></pre>
  
  <p>How do i find out the exact memory usage of  function_net() in a process (C program)? </p>
  
  <p>Is there any system call in linux to find out the same?</p>
  
  <pre><code>For example:
  
  /* How to find out the memory usage of this function */
  
  **void function_net()
  {
     int *a = (int *)malloc(200);
  }**
  
   #include&lt;stdio.h&gt;
  int main()
  {
     function_net();
  }
  </code></pre>