PDA

View Full Version : Program Memory Usage



DBQ
April 25th, 2011, 07:07 AM
Hi Everybody.

I am trying to measure the memory consumption of my C++ program. I am using VmPeak as my metric.

My problem is that I observed some strange memory patterns. When the main data structure of the program grows the biggest, the VmPeak is often lower then for the cases where the structure is significantly smaller. Why is that? Also, would you suggest a better metric for measuring memory usage of my program?

conradin
April 25th, 2011, 07:26 AM
Guessing here, I would prolly need to know how much ram you have, if anything goes to swap when your array goes to infinity or however large it gets. Maybe its being writen to swap? Is it being used or just stored? I seem to recall some OS function to put away mem space which isnt in use, but my OS class was like 6 years ago...

DBQ
April 25th, 2011, 07:28 AM
Thanks for the reply. The structure is both, used and stored.

DBQ
April 25th, 2011, 08:12 AM
Oops, sorry for double posting...