Sign in to follow this  
Geronimo2000

[.net] C# Program Slowing Down

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this