Debugging and Memory Management in Windows CE .NET
Posted April 1, 2003
Chat Date: March 5, 2003
Please note: Portions of this transcript have been edited for clarity
Chat Participants:
- Mike Salamone, founder and president of Entrek Software
- Peter Marcotte, consultant and developer with Entrek Software
- Michael Fosmire, Community Program Manager
Moderator: Mike (Microsoft)
Welcome to today's Chat. Our topic is Debugging and Memory Management in Windows CE .NET. We’re honored to have Michael J. Salamone and Peter Marcotte from Entrek hosting today.
Let’s introduce our hosts for today.
Host: Mike S (Entrek)
Hi, I'm Mike Salamone - founder and president of Entrek Software. I've been developing software for Windows CE for the past 7 years. Most recently Entrek has developed debugging tools to aid in the development of Windows CE software.
Host: Peter (Entrek)
It's great to be here. I am a consultant and developer with Entrek Software, Inc. I look forward to seeing your questions today.
Moderator: Mike (Microsoft)
Welcome everyone, let’s get started!
Host: Peter (Entrek)
Q: Can you tell me about the tools you offer? I’m an eVC newbie.
A: Entrek offers a memory leak detection tool for Windows CE/CE.NET called CodeSnitch, a process monitoring application called ProcMan, and numerous command-line tools for interfacing with Windows CE and CE.NET.
Host: Mike S (Entrek)
Q: I develop drivers for 2k and XP, how close is the debug environments?
A: With Windows CE.NET, you'll need to use the Windows CE.NET debugger. Windows CE.NET includes the Windows CE.NET operating system as well as tools (compiler, debugger, image-building, etc). The debugger has a look-and-feel similar to the Visual Studio
Moderator: Mike (Microsoft)
Q: I'm familiar with .NET in general but not the CE edition. What are some of the substantive differences?
A: Are you referring to the Compact Framework? You might check out https://www.gotdotnet.com.
Host: Mike S (Entrek)
Q: If CodeSnitch can monitor leak detection and whatnot in a mobile .NET application, couldn't it just as easily do the same for a WinForms application? The development of the two types of applications is one in the same.
A: CodeSnitch is somewhat limited in debugging .NET applications. It's mainly useful if you have any unmanaged code in your application. Our tools, including CodeSnitch, work exclusively on flavors of Windows CE. We have not ported them to the desktop
Host: Peter (Entrek)
Q: Is the debugging session hosted on Windows, with a network connection to the CE device and CE.net apps?
A: Yes. The device will gather data from various API calls and report to the desktop application.
Host: Mike S (Entrek)
Q: Does CE.net support a Profiler API the way that .NET CLR does?
A: We don't have the answer to this question. We can follow-up for you. Please send us email at support@entrek.com. You can also post to one of the Windows CE newsgroups such as microsoft.public.win32.programmer.wince
Moderator: Mike (Microsoft)
Q: What are the pros and cons of WinCE.net compared with other development options on the CE platform?
A: I'm not sure we understand the question. Are you asking about development tools (NetCF, eVC, etc) or platforms (Windows CE .NET vs Windows CE 3.0, etc.)?
Host: Mike S (Entrek)
Q: What is the initial outlay and what ancillary hardware is needed to develop and debug using Entrek?
A: In general, all you need is a method for communicating between the host and the target. Typically this is done over serial or, better, ethernet. It is configurable, though. Basically we will use the same connection you have configured for debugging.
Host: Peter (Entrek)
Q: Could someone post a link to a tutorial of debugging and documentation of this Code Snitch system, please?
A: Evaluations of the programs, including CodeSnitch, can be obtained from https://www.entrek.com. Numerous FAQs about the products are listed at https://www.entrek.com/FAQ.asp. Help documentation and tutorials are included with all products.
Host: Mike S (Entrek)
Q: I basically wonder how well WinCE.net works compared to other options. Since you say it is a platform, how do apps on it compare with apps on WinCE 3.0?
A: Milt, this is very dependent on your hardware (CPU, memory, etc) as well as how well Windows CE has been integrated (device drivers and other low level OEM code). You may want to ask for other people's experience with your particular hardware in a Windows CE.NET newsgroup such as microsoft.public.windowsce.platbuilder.
Host: Peter (Entrek)
Q: Can anyone talk about whether CE.Net uses two memory slots for a process (effectively giving a process 64meg vs the previous 32meg?)
A: In Windows CE.NET, the lower 32 MB for each process slot are used for program data and small heap allocations. The upper 32 MB is not unique to each process slot; it is shared among all processes, and it is reserved for system DLLs.
Host: Mike S (Entrek)
Q: Can the tools be used to measure the free virtual memory and usage?
A: Our tools report virtual memory usage on a per-process basis. We also have a virtual memory walker that will report all the regions (allocated, committed, and freed) in your process space, as well as show where DLLs are loaded.
Host: Mike S (Entrek)
Q: what about memory usage per thread
A: Memory is allocated by and owned by a process, not a thread. However, to find the total amount that a particular thread allocated, you could use our CodeSnitch tool, though it would take a little work on your part. I.e. we don't report that number, but the information required for you to derive that for yourself is available - though probably a bit painful to calculate.
Host: Mike S (Entrek)
Q: Did you guys end up having to use any apiset hooks for your tool?
A: No. We instrument the built binary.
Host: Peter (Entrek)
Q: How much are your tools and why would I want to buy yours as opposed to a competitor's?
A: Our pricing is listed on our website, https://www.entrek.com. I haven't seen too much competition in this area, but there are alternate solutions, although they are quite a bit more costly. I believe ours is the best solution for application developers-
Host: Mike S (Entrek)
Q: Do you guys offer support for using your tools and how far would that extend in the development process?
A: We provide email and phone support for our product. We will research any problems related to their usage. Sometimes that does get into your development, but we don't dive deep into that. We do provide debugging services on a contract-basis.
Host: Peter (Entrek)
Q: So, essentially what you're saying is that the 32meg process slot is finally all for the user process, rather than for the rest of the system?
A: Essentially. Each DLL resides in the same address in every process slot. Moving the system DLLs into slot 1 frees up a lot of space in slot 0 for user DLLs.
Moderator: Mike (Microsoft)
Q: Can unmanaged apps run on WinCE.net?
A: If you mean native code apps, yes. Built with eVC.
Moderator: Mike (Microsoft)
Q: Does Microsoft still support WinCE 3.0?
A: Yes.
Host: Mike S (Entrek)
Q: In the PB debugger thread window, there is KernelTime, UserTime, SleepCount, and SuspendCount. Can you provide some details on what these signify?
A: KernelTime and UserTime are simple time values that tell how much CPU time is spent in Kernel and how much in User. SuspendCount is for a thread - essentially how many times SuspendThread has been called. I believe the SleepCount is how much time is remaining for a thread that called Sleep().
Host: Peter (Entrek)
Q: Are there any time and memory profiling tools available? Generally, is time and memory a limited resource for most CE apps?
A: Entrek offers a command-line virtual memory walker, but I don't know of any function timing profiler or memory profiler other than the event output from CodeSnitch.
Host: Mike S (Entrek)
Q: How do I modify debugging zones so that the debugger picks up debug output from other processes?
A: There is a section in the Platform Builder help (do you have access to it) that tells you the necessary steps. If you don't have access, please send us email at support@entrek.com and we can give you the information.
Host: Ian (Stardock)
Q: Basically I have code that exists in other processes, and OutputDebugString is not caught from them. PPROCESS has ZonePtr, PMODULE has ZonePtr, and I see in kernel.h the various debug zones. So would modifying the debug zone in that DBGPARAM structure, say to ZONE_DEBUGGER, do it? (I'd be using SetDbgZone).
A: Ian, are you using the Platform Builder debugger or the eVC debugger?
Host: Ian (Stardock)
Q: evc
A: Do you have access to the Platform Builder debugger?
Host: Ian (Stardock)
Q: If the PB debugger will work with aftermarket platforms(pocketpc's, etc) I'll happily switch over
A: That would be your only chance to modify debug zones.
Host: Ian (Stardock)
Q: hmm, ok thanks.
A: Ahh - no it won't work with commercial devices such as PocketPC. Our tool actually captures OutputDebugString for non-system applications.
Host: Peter (Entrek)
Q: Why don’t you have a feature to save logs in ProcMan? Any Plans to put in such a feature?
A: Actually yes. The feature didn't make 1.x but 2.0 is slated to have logging available.
Host: Mike S (Entrek)
Q: What support is available for developing device drivers or the equivalent?
A: Our CodeSnitch tool can be used to instrument a device driver and aid in finding leaks. ProcMan can be used to monitor CPU time/usage as well as memory usage. We have specific information on our website regarding device drivers.
Moderator: Mike (Microsoft)
Q: Does WinCE 3.0 have some benefits compared with WinCE.net?
A: You might try exploring a bit on the Microsoft website for information specific to the types of features you’re concerned with.
Host: Peter (Entrek)
Q: Any release time frame for 2.0?
A: Not scheduled yet. I'd imagine by Q4.
Host: Mike S (Entrek)
Q: Any release time frame for 2.0?
A: we haven't announced any timeframe for 2.0.
Moderator: Mike (Microsoft)
Q: Is there a qualifying or certification process for CE drivers equivalent to WHQL?
A: Yes.
Moderator: Mike (Microsoft)
Thanks for joining us today and thanks for the questions. A special thanks to Michael Salamone and Peter Marcotte for hosting.
Moderator: Mike (Microsoft)
It's time for us to go now.
For further information on this topic please visit the following:
Newsgroups: Mobile and embedded application development topics
Embedded Transcripts: Read the archive
Website: Visit the Mobile & Embedded Developer Center
Top of page