correct way to perform garbage collecting

I am working on a project which I am trying desperately to optimize its performance.  I want to perform some reading and writing of a lot of data and perform some garbage collecting as the data is processed.  Anything working code will help.  I posted a question which some very good advice was offered, but I can’t seam to get the advice to work correctly.  I believe it is because I don’t quite understand how to make garbage collecting work efficiently.  My question is I want any good source code for using gc.collect properly.  I really want to try to improve a process where I believe garbage collecting may help alleviate some bottlenecks.  

Thanks you’re your time and valuable expertise,
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

if you try to do your own garbage collection, rather than allowing the GC to take place only when really necessary, you will actually get worse performance, rather than better.  


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
As Arthur_Wood said, you're really not going to gain any advantages by doing your own GC'ing.  If anything, you might want to call the GC right after you've just done a Dispose/Dereference of large sets of data and/or forms.  The problem, though, is that by forcing a GC, you're causing extra work for the system, and it can really be a ding in performance.
gr8lifeAuthor Commented:
As I stated I am researching as much as I can to optimize some code and I thought this may be a way to speed up the application. However after reading the posts here I see this approach is not the correct method. Thank you for your quick assistance and expertise.  I will research other options.
Have a great day,
glad to be of assistance.
 good luck on your search for performance gains.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.