Hi,
I have a background worker collecting xml and inserting into a SQL Express database whilst the main form must keep full responsive control. This all works fine except that my cpu usage goes from idling at about 8% to 60% when the doevents is called from within the following code:
do While Me.backgroundWorker1.IsBusy
Application.DoEvents()
End While
After putting a counter in the loop it can run about 500 iterations.
Now some of your answers to my problem may be that the code in the main form which application.doevents runs is the problem however when I debug the Application.DoEvents() line it steps into the sub defWndProc for the main form which doesn't help me find where the actual leaks are occuring?
Sometimes I could be collecting several XML messages at a time which can cause the CPU to completely lock up at 100% and then it just hangs and gives in. This happens on Vista and XP with 1 gig of memory (which is what many users have their pc's specced at)
Can anyone point me in the right direction for solving this issue?
Many Thanks
I have a background worker collecting xml and inserting into a SQL Express database whilst the main form must keep full responsive control. This all works fine except that my cpu usage goes from idling at about 8% to 60% when the doevents is called from within the following code:
do While Me.backgroundWorker1.IsBusy
Application.DoEvents()
End While
After putting a counter in the loop it can run about 500 iterations.
Now some of your answers to my problem may be that the code in the main form which application.doevents runs is the problem however when I debug the Application.DoEvents() line it steps into the sub defWndProc for the main form which doesn't help me find where the actual leaks are occuring?
Sometimes I could be collecting several XML messages at a time which can cause the CPU to completely lock up at 100% and then it just hangs and gives in. This happens on Vista and XP with 1 gig of memory (which is what many users have their pc's specced at)
Can anyone point me in the right direction for solving this issue?
Many Thanks