Reputation: 411
What are the conditions for the .net garbage collection not to run? does high cpu usage prevents the garbage collection from running?
I am working on a very large project with visual 2010 .net 4, I added new part of the project and now doing performance tests of it. during the tests I discover that when i put the clients in high load, almost 100% cpu all the time, the memory acts like there is a leak. after many tests which found nothing i used ANTS profiler, and found out than when I take snapshots each 5 minutes the memory acts like usual. ANTS force the garbage collection to work, so I came out with the question, Does .net garbage collection does not work in high cpu for not interrupting the application run?
Upvotes: 1
Views: 1618
Reputation: 411
After checking the issue, I came to conclusion that the high CPU prevented the GC from working properly. I tested it with calling the GC each several minutes the memory stayed low as it should (in normal runs of the program). after it i forked the main bottle neck of the program to several cores. the cpu went down and the memory again act good as usual in c# and .net - went up and down in constant range.
Upvotes: 2