Application memory usage measurement


We want to measure memory consumption of a driver application during run time as well as idle time.
We found showmem utility which gives these details, when checked out we see no changes in the memory consumption any time i.e. the values seen during runtime/idle are same.

Do we have any tool which meets above expectation?
or any suggestion on usage of showmem are welcome

Thanks in advance

The IDE has all these tools. Which version of QNX are you using?

We tried with IDE and we can see changes there, but we are looking for some utility keeping in mind to automate the measurement

You could use pidin -P mem

using pidin also we see no changes in memory usage at run time

Then pidin is right ( or you are not looking at the right place )

pidin -P devb-umass mem

 pid tid name               prio STATE            code  data        stack

532529 1 bin/devb-umass 10r SIGWAITINFO 28K 380K 8192(516K)*
532529 2 bin/devb-umass 21r REPLY 28K 380K 4096(20K)
532529 3 bin/devb-umass 21r RECEIVE 28K 380K 4096(16K)

#showmem -S -P -Dh|grep io-usb
[showmem] Process listing (Total, Code, Data, Heap, Stack, Other)
679936 143360 24576 466944 45056 0 151573 io-usb
679936 143360 24576 466944 45056 0 151573 io-usb
#showmem -S -P -Dh|grep devb-umass
458752 0 49152 290816 118784 0 368719 devb-umass
512000 0 57344 335872 118784 0 368720 devb-umass
#showmem -S -P -Dh|grep
348160 81920 53248 196608 16384 0 270372
348160 81920 53248 196608 16384 0 270372

above usage of showmem is at run time that is when the IO is going on the UMASS devices and even then i do not see any changes in heap memory (Some times i see changes in devb-umass)
this application mounts the UMASS devices
It will be great if i get an idea(please guide if any doc available) how showmem or pidin gets the information of process/app memory

While you can see changes in the HEAP memory with the IDE, there is (AFAIK) no command line utility that can see this. The IDE queries the processes internal heap manager through a special interface, while pidin simply shows the pages allocated to the process. It is entirely possible (in fact it is common) for heap usage to go up and down, while the pages allocated to the process remain constant.

Fortunately, if you are checking for leaks, the only thing that is usually important is whether the pages allocated to the process continue to grow, so pidin should work for you in practice.