View topic - Application memory usage measurement

Application memory usage measurement

General Help about QNX

Application memory usage measurement

Postby Shyam » Wed Jan 06, 2010 10:47 am

Hi,

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
Shyam
New Member
 
Posts: 5
Joined: Wed Jan 06, 2010 10:37 am

RE: Application memory usage measurement

Postby mario » Wed Jan 06, 2010 12:21 pm

The IDE has all these tools. Which version of QNX are you using?
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

RE: Application memory usage measurement

Postby Shyam » Wed Jan 06, 2010 12:29 pm

6.4.1
We tried with IDE and we can see changes there, but we are looking for some utility keeping in mind to automate the measurement
Shyam
New Member
 
Posts: 5
Joined: Wed Jan 06, 2010 10:37 am

RE: Application memory usage measurement

Postby mario » Wed Jan 06, 2010 3:35 pm

You could use pidin -P<processname> mem
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

RE: Application memory usage measurement

Postby Shyam » Thu Jan 07, 2010 4:26 am

using pidin also we see no changes in memory usage at run time
Shyam
New Member
 
Posts: 5
Joined: Wed Jan 06, 2010 10:37 am

RE: Application memory usage measurement

Postby mario » Thu Jan 07, 2010 12:22 pm

Then pidin is right ( or you are not looking at the right place )
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

RE: Application memory usage measurement

Postby Shyam » Fri Jan 08, 2010 4:21 am

# 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 <My app>
348160 81920 53248 196608 16384 0 270372 <My app>
348160 81920 53248 196608 16384 0 270372 <My app>


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)
<My App> 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
Shyam
New Member
 
Posts: 5
Joined: Wed Jan 06, 2010 10:37 am

Re: RE: Application memory usage measurement

Postby rgallen » Fri Jan 08, 2010 4:50 am

Shyam wrote:# 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 <My app>
348160 81920 53248 196608 16384 0 270372 <My app>
348160 81920 53248 196608 16384 0 270372 <My app>


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)
<My App> 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.
rgallen
QNX Master
 
Posts: 671
Joined: Thu Jul 11, 2002 6:48 pm


Return to Help

Who is online

Users browsing this forum: No registered users and 2 guests