Issues with Memory

  • Thread starter Thread starter BuddyWork
  • Start date Start date
B

BuddyWork

Hello,

Can anyone explain why this could be happening.
I'm running some code that does the same thing over and
over again. For example query the Sql database for
employees where the name begins with say 'A'. I run this
same query syncrously about 2500 times. Each time I look
at the overall computer memory foot print it just
increases slowly. I can see the memory foot print with my
application shrinking and growing, I can also see the GEN
0, 1 and 2 shrinking and growing as normal but the issue
is the machine memory keeps growing, it does shrink but
not enough, which then causes an System.OutOfMemory
exception to be thrown.

I am using Framework 1.1, I've tried service pack 1 but
no difference.
Any clues to why?
 
Make sure that you are .Dispose anything that implements IDisposable.
Or, you could use "using".

using (SomeClassThatImplementsIDisposable sctid = new
SomeClassThatImplementsIDisposable)
{
do stuff
}
 
Back
Top