Strange sudden shutdown issue with CF app

  • Thread starter Thread starter Shloma Baum
  • Start date Start date
S

Shloma Baum

Hi,

We have created an app that basically connects to a web service gets data,
then stores it locally on the device, and when a record needs to be
modified/added the system first tries to connect the web server sees if its
availible, if not then it stores in locally on the device until the
connection comes back, now I noticed that if the device does not mess around
with the data connection then the application sits nicely as long as its
open, and never gets shut down (unless the system automatically shuts it
down due to memory constraints).

However on devices that has a phone, and even more if the device is
connected to an exchange server with push email and/or there are calls for a
longer period of time, if you go back to the application afterword and while
doing basically anything that worked before (before a lengthy call or so,
don't know really what is causing but I've seen some indication that this
might be the case) like a charm but now doing that same action will blow out
the program, most of the times without any exception, and sometimes I would
get NullReferenceException and the trace will show really basic internal
trace, and everytime something else where the same action before worked just
fine, and also note that those exceptions point no where to anything related
to the connectivity of the device, but mostly front end stuff. But again
most of the time I get no exception at all but just simply disappears.

It might be that there are some external native exception that is not being
chought but am puzzled at where to start looking.

Hope someone might come up with some, as I'm puzzled and dont know where to
focus on.

Regards and thanks in advance
Shloma
 
You might want to start by wiring up the Unhandled exeption handler

AppDomain.CurrentDomain.UnhandledException +=
new
UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);

this should catch and allow you to track the unhandled execption.
I hope this helps.

Rick D.
Contractor
 
Rick,

I already do that, but unfortunatly it just shuts down without any exception
and sometimes with an AV, see my original post.

Thanks for your response though!

Shloma
 
It's quite possible that other activity on the device is causing memory
pressure and a WM_HIBERNATE message is then broadcast to all apps. Your app
would receive that and do a GC.Collect and it may also be shut down by the
OS. You can always handle the closing event to prevent that - an
IMessageFilter is also an option for knowing when these events occur.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Managed Code in an Embedded World
www.OpenNETCF.com
 
Thanks Chris!,

Could you point me to a link for more information on the topic on how to
catch that message and prevent it, I would really appreciate that.

Regards,
Shloma
 
Chris,

Do you know if a WM_HIBERNATE would be sent even if there are lots of memory
availible? the device has over 30 MB avalible and is still freaking out...

Regards,
Shloma
 
How much virtual memory is available for the current process? That's what's
going to trigger it, not physical memory. Phone devices are notoriously low
on virtual memory right out of the box because the OEMs decide to put every
little thing into its own DLL and then have 25 processes launched at boot.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Managed Code in an Embedded World
www.OpenNETCF.com
 
Chris,

I'm happy to inform you that it seems that this was indeed the issue, I had
lots of assemblies that were part of the project, some were 3rd party and
others were because the project are devided in layers and every layer had
its own dll, I've changed it that they should be devided only logical
instead of phisical and pliminery results show that the issue is gone....!!!

Thanks again for your help....

Regards,
Shloma
 
Back
Top