Sign in to follow this  
infra001

[.net] CPU Spiking with .NET (..Think it's GC)

Recommended Posts

Hello, I'm currently running a very large piece of software that uses up to 2.0GB of Memory, on bootup it loads with 1.4GB average, and slowly goes up and up till eventually it's restarted every 24 hours. However recently as the server database has got bigger, there seems to be more frequent CPU spiking - I've been told this is because maybe the Garbage Collection is not configured to a optimal setting that it could be, and the Garbage Collection (GC) is actually causing the CPU spike (..which causes the database to freeze completely for 3-seconds). I'm currently using .NET Framework 1.1 (Not SP1) as when I run SP1 it seems to be even WORSE... the CPU Spikes and more and more often, which has me totally convinced it's a .NET problem with the GC changes. Does anyone have any clues, or any optimisations to the GC I could do with the .NET framework itself ? Thanks for any help you can offer. --Nick

Share this post


Link to post
Share on other sites
Wait, you mean your actual application is loading 2GB of data into memory?

Maybe the first optomization you should do is actually find out if you need to be abusing the system like that. If you aren't going to be using all that data write it out to disk and get it when it is actually important. I highly doubt you are using 2GB of data activly in your application.

Share this post


Link to post
Share on other sites
How are you disposing of your database connections? Are you making sure to use the Dispose pattern? Have you run the profiler on the server to see if it is the GC that is causing the performance spikes?

Share this post


Link to post
Share on other sites
If you go to Start, Control Panel, Administrative Tools, Performance, you can view performance data for .NET, including garbage collection information. It might be more helpful to verify that the GC is actually causing problems, and to examine the problem in more depth. The relevant counters are in the ".NET CLR Memory" performance object. More information here.

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