I have a need to determine the memory used by a library for its user stack. The library i need to find this information about is zlib compression library. I linked this library statically with a small test program. I need to find how much stack growth is there during a single run of the program . Actually as i was going through this problem i ended up confusing myself. So i also would like to know whether the stack for process in unix can also end up being swaappped ?? .. I tried using gprof but it only gave me execution time profile ... are there tools in linux to determine memory usage .. also can the stack growth be monitored ? I would be grateful if i could receive some pointers in this regard.