Memory leaks or GC doesn't invoked?

T

Tod Johnson

Hello all,

I've written application that uses threads/timers and contains many
different forms. I've noticed that if I left my application for the
whole day then device show message that not enough memory.

I'm not using calls of unmanaged code (I suppose so) but maybe it's the
problem in the GC. Maybe I should force him to clean Gen0, Gen1 objects?
Or maybe there is tips how can I detect memory leaks?

Thank you,
Tod
 
A

Alex Feinman [MVP]

Make sure that the forms you create are eventually disposed of. E.g. if you
do this:

MyForm dlg = new MyForm();
dlg.ShowDialog();

then you would do well to call
dlg.Dispose().

Also make sure you are using SP2
 
T

Tod Johnson

Alex said:
Make sure that the forms you create are eventually disposed of. E.g. if you
do this:

MyForm dlg = new MyForm();
dlg.ShowDialog();

then you would do well to call
dlg.Dispose().
oh! thank you for the tips! I'll check it out.
 

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

Top