[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 243
  • Last Modified:

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,
Gr8life
0
gr8life
Asked:
gr8life
  • 2
2 Solutions
 
Arthur_WoodCommented:
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.  

AW
0
 
ZeonFlashCommented:
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.
0
 
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,
Gr8life
0
 
Arthur_WoodCommented:
glad to be of assistance.
 good luck on your search for performance gains.

AW
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now