Memory leak with Dataset?

  • Thread starter Thread starter Andrew Mueller
  • Start date Start date
A

Andrew Mueller

Hello all,

There is a message below 'Application Error... When querying data'.

What appears to be happening is that when I perform a lot of queries in
a row and bring back the information into a DataSet, the application will
crash. It will not crash every time, though.

It has a problem writing to certain memory locations, is what the error
states...

Any ideas what could be happening or do I need to post the code? There is a
bit of code, so I did not want to post it right away.

Thanks in advance!!

Andrew Mueller
 
It appears that, for some reason, I am running out of memory.... That is
just a guess. The problem happens more frequently when I am trying to do
multiple things at once. If I leave the application alone, it runs fine.
Don't know if this helps the analysis, but thought I mention it....

Andrew Mueller
 
More tests....

I ran performance monitor on memory and there was plenty left.... The
application continues to crash now whether or not I am running another
application. It appears that after it crashes one time, it is more apt to
do it again. Does garbage collection work properly? Is there some portion
of my RAM which is now somewhat corrupt (in memory)? I cannot explain why
it would do this.

It ran fine 10 times before I tried loading other applications. Once I
did this, it crashed. Once it crashed, it continued to crash each time I
ran the program.

It crashes during the portion where it retrieves information from OLEDB
and brings back a calculated value. That is the only thing that is
happening at the time.

Andrew Mueller
 
The error DEFINITELY happens when:

I set focus to another application. Whether that be Exporer, or
anything else, that is when it will crash for sure. No amount of error
trapping appears to catch the error.

Andrew Mueller
 
Can anyone verify a possible problem??

I belive that if I create new OleDbDataAdapter objects often, I get the
error that I am seeing. It only happens occassionally, though. Mainly, as
I mentioned before, when I am focusing on other applications.

Thanks in advance,

Andrew Mueller

PS - At this point, it seems to have helped that I only create one
connection and change the Select statement only. This is a change because I
added to the Method within the class so that all the data iteration is done
within the class (as opposed to in the Call)
 
Try trapping the Application.ThreadException event. It will give you any
exception that WindowsForms catches in its code. It might be a genuine bug,
but without more information it will be impossible to tell.
 
I know this sounds stupid.... But, I am a novice, and I am unsure how to do
this with a service application.

It seems there are a bunch of examples on the web for Windows Forms
applications, but none for services. Can you point me in the right
direction??

Thanks in advance,

Andrew Mueller
 
Back
Top