I'm working on MDI application written in C++ Builder 2010. When child window is in maximized state, application consumes 100% of CPU time in idle mode.
I have used 'Very Sleepy' profiler and it shows that function Sd_childFinalize
is using 99% of CPU resources but I can't find it in my code. sd_Child.cpp is the C++ unit where MDI child form class is defined. I only found @@Sd_child@Finalize
symbol in executable file. Please help me to understand how to debug this issue.
This appears to be a known issue related to actions and the way they are updated in the application idle handler. The following QC report describes your scenario: http://qc.embarcadero.com/wc/qcmain.aspx?d=12706
The solution to your problem, according to the QC report, is to set the TApplication.ActionUpdateDelay property to a value greater than 0.
What I would love to know is why the presence of a maximized client form leads to the VCL's DoActionIdle being called in a busy loop. Presumably execution of an actions's OnUpdate handler leads to another queued message, and another idle cycles, and so on. I'd have thought dealing with that would be the best way to tackle this issue, but perhaps it's hard to achieve.
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