How can I avoid the huge number of soft page errors generated by my C # .NET application?

I profile the C # .NET WinForms application and I noticed that it generates millions of errors and continues to grow while running ...

I know that in .NET the number of page errors generated by an application is usually large, but millions of page errors seem too large ... It seems that the application caused a race condition with GC, is this possible?

Is there any known poorly designed code that could lead to this situation? If the code does not have any hidden .NET platform settings that can reduce the number of page errors?

Can you avoid generating more and more page errors?

+7
source share
1 answer

I would recommend leaving this thing alone if this is not a problem. If you have performance issues, try and isolate the code that generates most page crashes. Maybe somewhere you are using a large memory object.

Try to keep your "unsafe" code as isolated and simple as possible, i.e. encapsulate all unsafe code in a class or function. Keep in mind that spoiling the .NET GC can lead to complications, mostly unnecessary.

Check out this article for a slightly unsafe introduction (this is a bit outdated, but still true): http://www.codeproject.com/KB/cs/unsafe_prog.aspx

In addition, you can increase the time before collecting GC, this can help

+4
source

All Articles