Jump to content
  • Advertisement
Sign in to follow this  
Geronimo2000

[.net] C# Program Slowing Down

This topic is 4865 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a C# program which loads some data and processes it. You can load the data in as many times as you like. The first time I load it in, it takes 30 seconds. The second time is 70 seconds. The third time is 105 seconds, the fourth time is 140 seconds as so on. I've looked at the memory usage and it's always stabilized at the memory capacity used when the data was first loaded in, so there is no apparent memory leak. I have turned manual garbage collection on and off, with no difference in the results. I've already looked many times for areas which could have been storing old data, but I have found none, and I have absolutely no idea what could be causing the program to get slower and slower each time. Has anyone else had a similar problem using C#, or would anyone venture a guess as to what this could be (.NET runtime? something else unrelated to .NET?)? Any ideas or suggestions would be most welcome.

Share this post


Link to post
Share on other sites
Advertisement
I am just taking a completely wild uneducated guess, but are you closing the file each time you are done with it?

Share this post


Link to post
Share on other sites
what sort of data is it, and how are you storing it? if you are just adding it a hashtable, but not clearing the tabel every time you reload, then there could be performance problems creeping into the app.

Are you catching any exceptions?

Share this post


Link to post
Share on other sites
each time it goes up by apparently one unit of processing time? (eg takes 30 seconds to do one chunk, 1x2, 1x3, 1x4, etc)

That kind of smells to me of something perhaps going through the process more then once... perhaps going over the same data more then once? A counter not being reset maybe?

As the other guy says it's kind'a hard to speculate without source, but I've got C# applications dealing with gigabytes of data and I can tell you that the only problems I've ever had with performance have so far been because I wasn't using the language quite right / some kind of logic flaw.

Share this post


Link to post
Share on other sites
Thanks for the feedback - I, too, think it has to be the reprocessing of data, but I just can't find any problem like that and the memory usage somewhat indicates to me that it's not that, but I'll have to keep looking...

I guess it's probably not a .NET problem though if no one here has ever had a problem similar to this.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!