Virtual Memory problem.

  • Thread starter Thread starter rollasoc
  • Start date Start date
R

rollasoc

Hi,

Our application, seems to run fine for several hours, then pops up with a
low virtual memory message. This sometimes then crashes the system, since it
will then say one of the objects has not been instantiated.

I'm assuming we've been a bit lax with the disposing of objects. Is there a
difinitive list of things we should be disposing manually?

The application is graphic intensive and we have been disposing of variosu
graphic \ pens and brushes objects, but what about temporary bitmaps (i.e.
backbuffers) etc.

Any tips as to what else I might need to Dispose rather than let the GC have
a go at an unspecified point?

rollasoc
 
You should call Dispose on every object that implements it. If an
object is finalizable, calling dispose will ensure it doesn't goto the
finalize queue, which will let the GC collect the memory sooner.

If calling Dispose doesn't fix the problem, look into profiling the
app.

-mike
MVP
 
Cheers Michael,

I've started disposing of things as I go and the problem hasn't been seen in
a couple of days (though I'm system testing it this afternoon, so we shall
see).

I've just downloaded a profiler as well, so will have a go with that.

rollasoc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top