I'm profiling a C# .NET WinForms application and i have noticed that it generates millions of soft page faults and keep increasing during the work ...
I know that in .NET the number of pages fault that an application generates is usually high, but millions of page faults seems too much... Seems that the application triggered a race condition with the GC, is it possible ?
Are there some known ill designed piece of code that can lead to this situation ? If not in the code is there some hidden settings of the .NET framework that can reduce the number of page faults ?
The generation of an increasingly high number of soft page faults can be avoided ?
I'd really recommends leaving this thing alone if it is not a problem. If you have performance problems though - Try and isolate the code that generates the most page faults - It is probably somewhere that you're using a large memory footprint object.
Try to keep your "unsafe" code as isolated and simple as possible, ie. encapsulate all the unsafe code in a class or function. Keep in mind that messing the .NET GC could lead to complications mostly unneeded.
Check this article for a bit of unsafe introduction (It's a bit old but still true): http://www.codeproject.com/KB/cs/unsafe_prog.aspx
Also, you could raise the time until the GC collects, this might help
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With