Windows Mobile memory leak problem
All,
I currently have a phone from a customer who has been experiencing various issues with the Windows mobile app. The problem is that the phone ends up completely resetting itself when the app starts. I have this in the house to do some testing and I haven't experienced reset, but I notice that program memory drops significantly when working through forms. We have a small memory leak from the application we are trying to narrow down, but nothing like that.
Eventually the application just falls out of the program memory, but it seems that not all memory is released. Program memory is not reverted to original memory. They installed some third party apps like VicSoft ClearTemp, but these apps seem to just delete temporary files to keep memory low. The phones in question are the Sprint 6800 Windows Mobile 6.0. The application is written in the .NET 2.0 Compact Framework.
We have an issue where the application is throwing a still actual issue from memory and it seems to be happening randomly. This problem seems to be directly related to memory, but perhaps they work hand in hand causing a crash.
Any ideas or help would be greatly appreciated.
- Steve
The application ending effect is probably caused by 1 of 2 things:
- An unhandled exception (probably OOM) makes it relax. You have to handle these .
- The WinMo platform itself kills the application via the WM_HIBERNATE message .
As already pointed out, make sure you call Dispose on all GDI related objects (bitmaps, handles, etc.). Descriptions of the error related to bitmaps can be found here and here .
Another thing to keep in mind is that the Components on the form are not selected when the form itself (as opposed to controls), so if you are doing a lot of create and destroy forms, pay close attention to this.
If you can upgrade a project to target 3.5, even if it is for internal testing only, running CF 3.5 CLR Profiler can certainly help you find the leak.
source to share
if its a memory leak, then the result program grabs more and more memory until it finally crashes due to lack of memory. This means that heap is created or allocated, but forgets that the memory was not released. If a memory leak occurs, then the memory is not available for the given program. for this particular solution, you can see this as well .
source to share