PL GUI uses a lot of cpu time

Started by arcanum, July 11, 2012, 07:22:48 AM

Previous topic - Next topic

arcanum

Hello,

Im using latest PL alpha/beta. Is it right that the GUI of PL uses 10-12 % of CPU power? When i hide the "graph" it stays between 0-1 %.

Quad core intel q9550 with latest ati drivers installed. XP Sp3.

For example, when i open Options window it takes about 3 seconds to respond.

Kindest regards,

-arc

edkiefer

That don't seem right . I am on XP SP3 too and PL is like 1% with graphs showing . all menu work instant .

Maybe try disabling each option in graph to see what it could be (memory bar, CPU utilization ).

Also maybe the polling rates are set to fast , you can adjust them up an down from default 1 sec (options>general>"recheck process ever ".
Bitsum QA Engineer

arcanum

Hi Ed,

I tried what you suggested. Disablin graphics options did not help.
I also disabled my Comodo IS but it did not help either.

When recheck my processes every 250 milliseconds it causes massive 25% cpu usage(when gfx options are enabled). Of course if i check them every 10 seconds it does not do that.

However, i narrowed down the problem a bit by uninstallin ASUS motherboard EPU engine(which is a powesaver program, sort of). After uninstalling it, PL still uses 7-8 of cpu time when gfx options are enabled.

And im not using a laptop PC.

Maybe my ATI drivers is the cause of this? Because i think that Jeremy uses just basic GDI functions to draw those memory bar, cpu utilization etc graphs.

Kindest regards,

-arc






Jeremy Collake

#3
Ah, you've hit one of the issues I have marked here as a blocker on v6. It is VERY RARE, but .. needs fixing.

I am very sorry you have experienced it. It applies to a very, very small minority of XP systems with certain other software and/or configurations.

Yes, I use standard GDI and GDIPlus APIs for drawing the graph. It is double-buffered and pretty optimal, at least normally. Like almost everything, I insisted on doing it myself. This is one of the times insisting on doing everything myself bit me in the butt, as my graph isn't even that pretty ;p.

The issue you see I have seen ONCE before, but *only* in a single XP virtual machine (of a plethora of physical and virtual test beds). Coincidentally, it also had COMODO installed, though I'm not going to blame COMODO, that is probably just a coincidence. I test against all the security suites, and this just happened to be that test bed.

I could not reproduce it in any other context. The drawing is actually fairly optimal, as it is simple 2D stuff - there is no need for DirectX or OpenGL, nor would it even be beneficial. I was unable to determine what was going on, and thus this is still on my agenda. Toggling hardware acceleration in the virtual machine did not seem to affect matters.

I also run AMD/ATI cards here on my primary development machine, so test with them more than anything. Therefore, it is not a general driver issue with AMD/ATI, but there MIGHT BE issues with specific configurations.

The odd thing is that I've tested on hardware with far inferior resources (little netbooks, etc..) and had excellent graph drawing performance.

I did notice that RAM conditions may impact the performance of the graph. So, what are your RAM conditions? e.g. What is the load shown to you by Process Lasso?

I am very sorry for this errata. Part of version 6 is a massive Q/A effort. 2K and XP users got left behind a bit in some the later updates to version 5, and I am rectifying that. This issue has *never* been seen in anything but that one XP test bed.

If you would like, I would be curious to see a HiJackThis log ... it *might* be helpful, though then again - might be useless. I could, however, correlate what the similarities between that one test bed and your PC are. I do promise this will be resolved, even if I have to rewrite the graph from scratch or license a third party library instead of my own code. Needless to say, after all the research and work on the core technology, I am not going to let a stupid graph ruin my software for ANYONE :o




Problem: Excessive CPU use by the Process Lasso GUI *when* it's main window is OPEN, VISIBLE, and the GRAPH is shown on some small minority of 2K/XP systems. Otherwise, does not manifest unless all three conditions met. Well, four if you include that it must be 2K/XP.

Guidance: Disable/hide the graph. Optionally, you may try older versions, e.g. v3.84.8, though I doubt it performs any different.

Resolution Status: Investigating. Marked as a blocker before v6 will be allowed to go final.

ETA to Resolution: 2 weeks or less (yes, this is high priority despite it only affecting a very small number of users.. who knows the real number). No Vista or above users have ever reported such a thing, and you are the first XP user to report it. I had honestly kind of hoped it was an anomaly of my virtual machine, as I have had no other independent verification until now.
Software Engineer. Bitsum LLC.

Jeremy Collake

#4
I was evaluating the code, and you might try this ....

For Windows 2K and XP, one oversight I made was assuming that if GDIPLUS.DLL was installed on the system, there is no point in putting my own copy in the Process Lasso folder (where it should go to prevent DLL hell). In cases where it did not already exist, I do put it in Process Lasso's folder. Therefore, you might try extracting GDIPLUS.DLL into Process Lasso's folder. Here is the copy: http://bitsum.com/files/gdiplus.exe (EDIT: Needs updating, turns out I didn't have the latest). Again, recommend extraction into Process Lasso's folder, but you can optionally place it in the SYSTEM32 folder if you choose (as this should be the latest issued).
Software Engineer. Bitsum LLC.

Jeremy Collake

Here is the latest GDIPLUS redistributable module from Microsoft for 2K/XP (from then on it was included in the OS): http://www.microsoft.com/en-us/download/details.aspx?id=18909 . They've abandoned 2K, which is why it is not listed. Why I still support 2K I wonder, as I have to use an older set of build tools just to build for it.
Software Engineer. Bitsum LLC.

arcanum

Hi Jeremy,

I tried what you suggested, copied gdiplus to PL folder and i also update my ATI/AMD drivers, but no succes. Procesgovernor still hogs 7-10 % of cpu time when gfx enabled.

Like i said before, my current system is XP Sp3 with latest updates, ATI with latest driver. 2.8ghz quad core with 4 gb of ram.

Other programs started during startup:

O&O Defragger
Geswall
Comodo IS (uninstalling it does not help, like i stated before)
Keyscrambler

My suggestion:
- if we draw gfx via OpenGL or DX, does it help?
- if possible, i do like to test pre-beta PL with dx/ogl drivers. Just curious if that solves the problem.

For example, O&O defragger, like othe programs draws the gfx via GDI. So its really mystery for me, why PL causes 7-10 % cpu time when gfx is on. I also noticed that my gfx card (4870 x2) fan goes high when displaying the gfx of PL.

Kindest regards,

-arc


Jeremy Collake

There's no easy switch from GDI to OpenGL or DirectX APIs, trust me. That said, there are probably third-party alternatives and/or modifications I could try. All of it may get deferred to the next beta, as I don't want to make big changes this week. However, the next beta will start as soon as v6 final is issued. From what I've seen, whatever the issue is, it doesn't affect many systems, so I'm going to do my best to optimize a bit further between now and the final v6 and see if that mitigates the issue for those affected as much as possible.
Software Engineer. Bitsum LLC.

Jeremy Collake

I do have a theory on this, btw.. which is why I can hope to solve it with some optimizations.
Software Engineer. Bitsum LLC.

arcanum

Hi Jeremy,

It has to do with ATI/AMD drvivers.

I, please,asking you,  convert your GDI routines to ogl/dx so we can sort if this a ATi problem.

Or, code a routine that logs prosessgovernor itself.

Jeremy, PL helped me a lot. This itty bitty problem drives me crazy.

-arc




Jeremy Collake

Ok ;).

I am having to work on core issues and get v6 final out the door.

HOWEVER, I will re-write the graph either using OpenGL, DirectX, *or* change my GDI code in such a way that it mitigates whatever this strange slow painting issue is. I mean, can't take that long, so ok ;)

The thing is, whatever the cause, it would also seem to affect other parts of the PC. I would imagine, ya know? Unless I'm painting the graph in some unusual way, which I suppose is possible. I'll make a few benign changes before v6 final, just in case it incidentally fixes this. LOL, a few benign changes, famous last words. Seriously, there is an optimization I've been wanting to try that might mitigate it to the point it doesn't matter...  maybe, since we only barely know the cause of this rare phenomenon. All systems affected have been running AMD/ATI display drivers, *but* also a great many more systems I've seen running AMD/ATI display adapters have NOT been affected ;o. Go figure.

I will say those Catalyst drivers have some issues. Quit downloading them from AMD/ATI and go with what Microsoft pushes out. Since they swapped to this new 'rapid release cycle' (the latest fad, a copy of me except for the major version numbers ;p), the quality has gone down. I tried installing their latest Catalyst Suite and it BSOD'd my PC for the first time since I built this PC (AMD 6450x2). I lost some data even, my Google Chrome profile to be precise, but fortunately there is Google Sync. Could have been much worse.

Software Engineer. Bitsum LLC.

BenYeeHua

No been affected on a old computer with integrated graphics x1250.  ;D
The Catalyst driver are outdated(not supported), and never facing problem like (display drivers stopped responding) because it is Windows XP and never BSOD with the Catalyst driver.

And now the laptop(that not mine) only facing (display drivers stopped responding) when watching YouTube with no more than 5 times.
Maybe the DXVA and Direct2D(used by browser) has some conflict.
----
Out of topic
I think I am too lucky(or bad luck), when I borrow my friend laptop with some problems to fix it, I never face the problems that her is facing like overheat and auto shutdown even the graphic card was 92° when playing game.
On that time my friend say that the laptop are afraid of me, so the problems don't come out.  ;D

arcanum

Hi Jeremy,

Can you, please, code your graphics routine using dx or ogl? So we can narrow the problem.

Do you use basic GDI functions when you do the gfx? Because i think this is ati/amd driver problem.

In other hand, im very, very happy with PL and how it works. Its a damn beauty of code!

Like my friend said: "coders do it with a routine" :D

Best regards,

-arc

Jeremy Collake

Quote from: arcanum on July 23, 2012, 01:06:27 AM
Can you, please, code your graphics routine using dx or ogl? So we can narrow the problem.

I agreed to do this above (I ramble a bit, so maybe missed ;p).

However, I am on a very tight schedule, so can't give a time frame. Now that v6 final is finally out, there will be just a little maintenance on it, then I have to work on PECompact, and then start Process Lasso v6.1 beta - at which time I can finally get to this ;o. I *might* get some wild hair one night and play with this, who knows. I DO AGREE though to further investigate and see what potential work arounds are available.
Software Engineer. Bitsum LLC.

Jeremy Collake

This is now nearing the top of my queue. While it is odd that a minority of systems are affected by this, I am initiating the following actions:

1. Mitigation methods ASAP
2. Rewrite of entire graph

I do not like to put dates on things, but just wanted to note that it has finally risen to the top of the queue here. I am deferring some other chores so that this can be addressed.
Software Engineer. Bitsum LLC.

BenYeeHua

Did the CPU usage will decreasing more when it fix?(for normal user that not having this problem)  :)

Jeremy Collake

Only marginally, if any. For most users this is a non-issue as the painting by GDI consumes very few CPU cycles. The updates to the listview consume 10x more (when the main window is open).
Software Engineer. Bitsum LLC.

Tarnak

Quote from: BenYeeHua on September 03, 2012, 02:36:20 AM
Did the CPU usage will decreasing more when it fix?(for normal user that not having this problem)  :)

LOL...I have never been a normal user.  ;)  That is why I have a problem. :)

BenYeeHua

Quote from: Tarnak on September 03, 2012, 03:08:20 AM
LOL...I have never been a normal user.  ;)  That is why I have a problem. :)
LOL...Me too  ;D
I like to optimize the Windows with my behave and the environment/hardware of the computer, by changing the UI etc  ;)
----
QuoteOnly marginally, if any. For most users this is a non-issue as the painting by GDI consumes very few CPU cycles. The updates to the listview consume 10x more (when the main window is open).
For example, Netbook  :)

Jeremy Collake

I regularly test on an Acer Netbook, it is one of my physical test beds. I do the best I can to simulate *real world* environments, hence I let my wife use the netbook ;p. Her usage of it simulates actual user experiences. On this Netbook, again, there is no issue with the graph. As we've suspected, it is believed that the differences in behavior are due (somehow) to the graphics adaptor driver, though I am honestly a bit vague on why or how this would vary between systems. I *suspect* it may have something to do with the amount of GPU memory available, and whether any (or how much) is shared system memory. Having too little memory would induce page faults which could cause this excessive CPU utilization.
Software Engineer. Bitsum LLC.

BenYeeHua

QuoteI *suspect* it may have something to do with the amount of GPU memory available, and whether any (or how much) is shared system memory. Having too little memory would induce page faults which could cause this excessive CPU utilization.
Yes, the flash that having memory lack, has causing lag on the flash game.
And the graphic card(3150) that is not support H.264 DXVA, browser hardware acceleration is one of the problem.  :P

Jeremy Collake

Quote from: arcanum on July 23, 2012, 01:06:27 AM
Do you use basic GDI functions when you do the gfx? Because i think this is ati/amd driver problem.

Basic GDI. Nothing else.
Software Engineer. Bitsum LLC.

Jeremy Collake

How many processes have you got running?   (if a lot, let me know)
What is the refresh rate of the GUI?  (if you didn't change it, don't worry about finding it)

I suspect that security software is scanning while Lasso is doing it's thing, and that may be where the activity is coming from.

I gotta install BitDefender in a test bed and see what in the world it is doing inside Lasso.
Software Engineer. Bitsum LLC.

BenYeeHua

QuoteI gotta install BitDefender in a test bed and see what in the world it is doing inside Lasso.
Monitoring the activity of PL?
As I know some security software like to record what's the unknown processes are doing, then reverse what it had done after found it is a virus.  :)

Jeremy Collake

No, not for that - it has some separate issues. Some hooks it injects into Lasso cause problems. Not sure what, yet.
Software Engineer. Bitsum LLC.