Issues with Memory

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • BuddyWork

    Issues with Memory

    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.OutOfMem ory
    exception to be thrown.

    I am using Framework 1.1, I've tried service pack 1 but
    no difference.
    Any clues to why?
  • stork

    #2
    Re: Issues with Memory

    Make sure that you are .Dispose anything that implements IDisposable.
    Or, you could use "using".

    using (SomeClassThatI mplementsIDispo sable sctid = new
    SomeClassThatIm plementsIDispos able)
    {
    do stuff
    }

    Comment

    Working...