How to measure memory usage inside my program? (getrusage)