hi..
In my application so many variables and XML files are used ..
eventhough after finishing off the work with the file, im closing that.
It works fine with few number of files but when i uses more than 50 files
the application crashes...
So. is there any way to resolve this by clearing the memory.
need help !!!

How to free up memory in C# apps?
Little John
GC.Collect() is perhaps a nice way to avoid 'the embarrasing pause'. It should not be used often though, but the GC can't possibly know when is a good time to garbage collect if your program is a constant flow in the background, but there are moments when the user do not expect any immediate response.
DBAcrobat
UncleRedZ
You need to make sure you call Dispose on any variable that has that method, before it goes out of scope. But, the garbage collector should ensure that your app never crashes from lack of memory.
Rameshb106
No. You'd call Dispose on the objects in the map, which is what you should do, and then there would not be a problem. The garbage collector is optimised, you should let it do it's job.
Fat Dragon
MSMC
You can force the garbage collector to do an immediate clean-up by calling it's collect method:
I was working with an image program before, which loaded images as bitmaps, and cycled over many images in a directory, processing them, saving them, and then moving on (and yes I called .Dispose() after finishing with my imaging objects). I found that if I didn't call the
Collect()method, it'd just be thrashing for ages (ie virtual memory paging).Have a look at task manager's Performance tab, or use Performance Monitor to have a look at the effects of calling this method.
CarlDemelo
GC.Collect is almost always a bad idea. I write image processing code in C# daily and I've never had memory problems.
Michael Junkin
any ideas
vidman