Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
End Users
Pocket PCActiveSyncMultimediaEBooksWirelessSmartPhones
Developers
Windows MobileSmartPhonesWinCE ProgrammingVB for WinCEVC++ for WinCEPlatform BuilderTest Tools
PocketPC DirectoryFree SoftwareWeb Resources
Related Topics
PalmMobile PhonesMore Topics ...

Pocket PC Forum / Developers / Test Tools / November 2006

Tip: Looking for answers? Try searching our database.

Can app verifier detect memory leak in a driver?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Cindy - 31 Oct 2006 06:44 GMT
and how?

thanks!
Michael J. Salamone - 04 Nov 2006 22:18 GMT
I *think* it can, but I'm not certain.  I think it can do checkpoints, and
you have to take checkpoints at different times and diff them.  I *think*.

You can try our tool CodeSnitch (not free though).  It does work on drivers,
but you have to use the info it gives you and analyze on your own.  The
problem is that these tools really don't determine what has leaked until a
program terminates.  Typically the device driver host process never
terminates (they usually run in the context of the system process device.exe
which never terminates).

With CodeSnitch, you get an event for each alloc/free in a listview (UI runs
on desktop).  Each event is color-coded.  When a block gets allocated, you
see it show up in blue.  When freed, the alloc event turns gray (the free
event is gray, too).  So what you can do is look at each blue alloc
(hopefully there aren't a lot in your driver unless there really is a leak)
and then make an assessment based on your code and how your driver works if
it looks like a leak that needs to be corrected.

Follow link below for more info.  There is a free (limited) eval.  If you
try it, in addition to the eval download, you need to install another piece
for it to work with device drivers.  From the main page, go to Utilites and
search for "csdelay.exe".  Instructions included.

Signature

Michael Salamone [eMVP]
Entrek Software, Inc.
www.entrek.com

> and how?
>
> thanks!
Sing Wee [MSFT] - 22 Nov 2006 07:14 GMT
Hi Cindy,

As Michael suggested, it is possible to detect memory leaks in drivers using
checkpoints, at least in Windows Embedded CE 6.0.

Assuming you're using the Heap Verifier shim (shim_heap.dll), then you can
set up a checkpoint by typing the following in your Platform Builder WinCE
prompt:

heapverif nk.exe chk         <------ Sets up the checkpoint for the nk.exe
process.
[...exercise your driver...]
heapverif nk.exe delta       <------ Checks for leaked memory since the
checkpoint.

Assuming the appropriate DLLs have been loaded properly, you can get more
information on heapverif's command-line options and arguments by typing '?'
(question mark) in the Platform Builder WinCE prompt.

------
Sing Wee [MSFT]
This posting is provided "AS IS" with no warranties, and confers no rights.
Please do not send e-mail directly to this alias. This alias is for
newsgroup purposes only.

>I *think* it can, but I'm not certain.  I think it can do checkpoints, and
>you have to take checkpoints at different times and diff them.  I *think*.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.