
Memory Leak Detection Douglas Boling President Boling Consulting Inc. www.bolingconsulting.com MEDC DevCon 2005
Memory Leak Detection Douglas Boling President Boling Consulting Inc. www.bolingconsulting.com

Microsoft MEDC Mobile Embedded DevCon 2005 Las Vegas-May 9-12 MEDC DevCon 2005

Speaker Douglas Boling dbolingmedc bolingconsulting.com Author-"Programming Microsoft Windows CE 3rd Edition" o Trainer-Classes on Windows CE App Development Windows CE OAL Development Consultant-Work with companies to help their application and platform development efforts MEDC
Speaker Douglas Boling dbolingmedc @ bolingconsulting.com Author – “Programming Microsoft Windows CE 3rd Edition” Trainer – Classes on Windows CE App Development Windows CE OAL Development Consultant – Work with companies to help their application and platform development efforts

Windows Mobile Windows CE5.0 Windows Widows Hardware/privers OEMAHV Supplied BSP OEM Hardware and Standard PC (ARM,SH4,MIPS) Standard Drivers Hardware and Drivers Windows XP DDK Platf-suilder Windows Embedded Studio Lightweigh EDB SQL Server 2005 Express Edition Relational SQL Server 2005 Mobile Edition SQL Server 2005 Native Win32 MFC 8.0,ATL 8.0 Managed .NET Compact Framework .NET Framework server side ASP.NET Mobile Controls ASP.NET Multimedia Windows Media DirectX Location services MapPoint Development Tools Visual Studio 2005 Internet Security and Acceleration Server communications Exchange Server Messaging Live Communications Server Speech Server Device Update Agent Management Image Update Software Update Services Tools Systems Management Server Microsoft Operations Manager
Management Tools Communications & Messaging Device Update Agent Software Update Services Live Communications Server Exchange Server Internet Security and Acceleration Server Speech Server Image Update Location Services Multimedia MapPoint DirectX Windows Media Development Tools Visual Studio 2005 MFC 8.0, ATL 8.0 Native Win32 Managed Server Side Lightweight Relational EDB SQL Server 2005 Express Edition Data Programming Model Device Building Tools Hardware/Drivers Windows XP DDK Windows Embedded Studio Platform Builder OEM/IHV Supplied BSP (ARM, SH4, MIPS) OEM Hardware and Standard Drivers Standard PC Hardware and Drivers SQL Server 2005 Mobile Edition SQL Server 2005 ASP.NET Mobile Controls ASP.NET .NET Compact Framework .NET Framework Microsoft Operations Manager Systems Management Server

Agenda o Intro oLMemDebug Application Verifier CeLog Data MEDC DevCon 2005
Agenda Intro LMemDebug Application Verifier CeLog Data

Memory Leaks... o...are deadly Embedded/Mobile devices run constantly o They aren't treated like a PC o System's are designed with just enough memory to do the job More cost too much MEDC
Memory Leaks… …are deadly Embedded/Mobile devices run constantly They aren’t treated like a PC System’s are designed with just enough memory to do the job More cost too much

Agenda LMemDebug O Application Verifier CeLog Data MEDC DevCon 2005
Agenda LMemDebug Application Verifier CeLog Data

LMemDebug o Monitors heap APls Provided in Platform Builder o Access through 'Shell'tool MEDC DevCon 2005
LMemDebug Monitors heap APIs Provided in Platform Builder Access through ‘Shell’ tool

Programmatic LMem Applications can control LMemDebug oAppend extra information to allocs o Set flags per allocations o Set flags globally o Applications can tag memory allocs HeapAllocTrace Easily tag allocs with file and line number MEDC
Programmatic LMem Applications can control LMemDebug Append extra information to allocs Set flags per allocations Set flags globally Applications can tag memory allocs HeapAllocTrace Easily tag allocs with file and line number

Using LMemDebug Use Shell to query memory status LMem *[recent][hist][chk][delta][info] [|*][breaksize ][breakcnt ] proc Proc index,name,PID or (for all processes) recent Show list of recent allocations hist Show histogram of alloc size chk Checkpoint all current allocations delta Report allocations since checkpoint info Report any additional info stored with the allocations (stack etc.) heap Heap index,handle or for all heaps breaksize Break when size is NN breakcnt :Break when count is NN MEDO DevCon 2005
Using LMemDebug Use Shell to query memory status LMem |* [recent] [hist] [chk] [delta] [info] [|*] [breaksize ] [breakcnt ] proc : Proc index, name, PID or * (for all processes) recent : Show list of recent allocations hist : Show histogram of alloc size chk : Checkpoint all current allocations delta : Report allocations since checkpoint info : Report any additional info stored with the allocations (stack etc.) heap : Heap index, handle or * for all heaps breaksize : Break when size is NN breakcnt : Break when count is NN