performance - how to reduce CPU usage of WPF application? -


High CPU used in my WPF application after about 30 minutes, then I use what code the application costs high CPU usage Break to find out, but I did not find anything

Visual Studio 2008 can not display the current running code, but I found this in the "Call Stack" panel:.

 [In a sleep, wait, or] mscorlib.dll! Join System.Threading.WaitHandle.WaitAny (System.Threading.WaitHandle [waitHandles millisecondsTimeout int bool exitContext) + 0x8f bytes System.dll! System.Net.TimerThread.ThreadProc () + 0x2f9 bytes mscorlib. Dll! System.Threading.ThreadHelper.ThreadStart_Context (Object State) + 0x66 bytes mscorlib.dll! System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback Callback, Object State) + 0x6f bytes mscorlib. Dll! System.Threading.ThreadHelper.ThreadStart () + 0x44 bytes 

What's this? What's the point with high CPU usage? And how to reduce CPU usage?

"itemprop =" text ">

We used the" View Profile Toolbox for Visual Profile "/ visual profiles that most of the events Take CPU usage Tick ​​(Time Manager.Tech.) Used to take around 40% of the app's CPU, we removed all animation-controls one by one, in the end, we found that after about 30 minutes on the storyboard the increase in CPU usage Will be.

Then we changed the form:

  calendar storyboard .biz (txtMessage, HandoffBehavior.Compose, true);  

to

  calendar storyboard. Banger (txtMessage, HandoffBehavior.SnapshotAndReplace, true);  

This problem was fixed. More information about HandoffBehavior please see msdn:


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -