Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » High CPU in 2.84 Collapse All
Subject Author Date
Offer Har Jan 13, 2009 - 8:12 AM

Dear Support,


We notice that after upgrading to 2.84, the CPU consumption of the CPU is very high - it takes one CPU core to 100% all the time.


We see that the stack is always around this:


     ProfUIS284md.dll!_RTC_CheckStackVars(void * frame=0x0012f57c, _RTC_framedesc * v=0x0111703c)  + 0xd bytes    C++

>    ProfUIS284md.dll!CMap<CExtHookSpy *,CExtHookSpy *,bool,bool>::Lookup(CExtHookSpy * key=0x07d98d2c, bool & rValue=false)  Line 1575 + 0xf bytes    C++

     ProfUIS284md.dll!CExtHookSpy::HookSpyItem_t::IsRegistered(CExtHookSpy * pHS=0x07d98d2c, unsigned long dwEHSEF=4294967295)  Line 802 + 0x13 bytes    C++

     ProfUIS284md.dll!CExtHookSpy::HookSpyIsRegistered(const CExtHookSpy * pHS=0x07d98d2c, unsigned long dwEHSEF=4294967295)  Line 1814 + 0x19 bytes    C++

     ProfUIS284md.dll!CExtHookSpy::HookSpyIsRegistered(unsigned long dwEHSEF=4294967295)  Line 267 + 0xd bytes    C++

     ProfUIS284md.dll!CExtHookSpy::HSLL_OnCallWindowProcIn(bool & bCallNextHook=true, long & lResult=0, int nCode=0, bool bMessageSentByCurrentThread=false, tagCWPSTRUCT * pMessageData=0x0012f6f8)  Line 1592 + 0xa bytes    C++

     ProfUIS284md.dll!CExtHookSpy::HookSpyItem_t::SHS_HookCallWindowProcIn(int nCode=0, unsigned int wParam=0, long lParam=1242872)  Line 1242 + 0x27 bytes    C++


Please explain what these functions, hooks & spys do... we must reduce the CPU, as this is when our application is completly idle.


Thanks,


Ron.

Carsten Pedersen Feb 12, 2009 - 12:51 AM

Could you please take a moment to help me figure out this problem? We have a computer that runs an app which doesn’t have the problem, but my app is. How can we find out what is wrong? As mentioned, everything works with 2.83 so it’s annoying to be struggling with these things that are not core problems og our project.


 


Another thing, why doesn’t this thread appear at the top of the forum list when answered?

Carsten Pedersen Feb 10, 2009 - 2:37 AM

I am using Windows XP. The program is a dialog application, and yes We trap some keyboard input keys using the

BOOL ProcessMessageFilter(int code, LPMSG lpMsg) function in main dialog class. Even if we try to out-comment it, in never reaches the code before entering CWinApp::PreTranslateMessage(pMsg); in the PreTranslateMessage method

A colleague of mine is doing another Dialog app, but doesn’t have the problems with buttons at all. Can you think of any things to try to compare the two programs in order to solve the issue? What to look for?



Technical Support Feb 9, 2009 - 1:34 PM

We cannot reproduce this problem using the ProfUIS_Controls sample application. We tried to press different buttons in it using mouse, space key and keyboard accelerators, but we saw only a small CPU usage caused by fading animation. We tried different paint managers and result is the same. Which windows version should we use for reproducing this problem? Do you have any software which hooks keyboard on your system? Some funny replacement of standard Windows Language Bar? Some other extension which hooks keyboard via injecting DLL into all the processes running on your desktop?

Carsten Pedersen Feb 9, 2009 - 8:50 AM

Hi,


I have the same problem. The application which worked under 2.83 is now using the 2.84 compiled ProfUIS284ymd.lib. The application starts up fine, tab window works when pressing the different tabs, but when I press a CExtButton, the app stalls and the CPU goes to 100%.


When I pause the app, I can see that it is stuck in an endless loop in ::HookSpyItem_t::SHS_HookCallWindowProcIn


LRESULT CALLBACK CExtHookSpy


Is this helpful enough to debug?

Hopefully you are able to find the error.


Best regards,


Carsten


Technical Support Jan 14, 2009 - 12:19 PM

The CExtHookSpy class implements an interface for thread-wide hooks. The classes derived from it can handle mouse/keyboard messages and intercept window procedure invocations. We have optimized this class in Prof-UIS 2.84 for reducing CPU usage. All the hook spies in Prof-UIS 2.84 are intercepting less possible number of events. Pleas provide us with more details about the problem. When it occurs and when not?