Question : Memory Error crashing VB.NET application

A program I am developping in VB.NET is suffering from an inconsistent memory related crash, and I have decided to sign up for an Experts Exchange account in the hopes that someone can offer some assistance with this frustrating issue.

This is a program that runs for long periods of time.  Windows error reporting is turned off, yet this error box still appears.

I will give a brief rundown of the code structure, and should more information be necessary I will be as specific as is required.

frmMain launches 11 threads.  Each thread begins a timer, and at set intervals launches yet another thread.  The purpose of these timer-launched threads is to launch yet more threads that will each perform a "scan" of sorts against a list of machines on the local network.  One specific scanning thread which runs far more often then all the others is the problem thread.  It will run fine for a while, then I hit a memory error and the thread dies.  All 10 other threads remain functional, as I am tracking the output of each.  

I am not able to reproduce the issue.  I have reports of it crashing within an hour of being started, yet sometimes it will run for days with no issues, and sometimes it will run with no issues period.  All of my code is inside try/catch blocks.  My application will remain open, all other threads still running fine until OK is pressed on the error message, which causes the application to shut down (sometimes!!!).  The error messages sometimes repeat and stack on top of each other.

Any assistance would be greatly appreciated!

Answer : Memory Error crashing VB.NET application

"Web Forms" ,  web application
"windown FOrms" , windows applciation(think client)

Yes, this implementation will catch all unhandles exception.

1. Register any/both(UI and Non_UI) accordingly in ur application.
2. Change the logic to write to a file or do as it is given in the sample writing to the EventLog. You can also add some other data if possible to the logs.
3. Next time when u have the same problem, check the log/eventlog to get more details on the error which should give some clues.

Yep, Form setting will override the settings which is there in app. config file.  Now u have a method which will be trigered so you can can write any information possible.Try to log exception message, stack trace and recursively loop the inner exception and get inner exception msgs.
Random Solutions  
 
programming4us programming4us