Page 1 of 2

Constant CPU Usage

PostPosted: June 23rd, 2018, 5:44 am
by metal450
Whenever I have a PHP project open in Visual Studio, devenv.exe keeps the CPU pegged at ~25% (my system is quadcore). This doesn't happen with any other type of project (i.e. C++, C#, etc). I've seen several other threads on here with similar issues, i.e.:

viewtopic.php?f=21&t=1448&p=6888&hilit=cpu+usage#p6888
viewtopic.php?f=21&t=1740&p=7865&hilit=cpu+usage#p7865

Is there a way to avoid this? I'm not sure what it's constantly working so hard to do, but it makes development extremely difficult (not to mention the laptop heats up, not to mention running off a battery becomes impossible).

Re: Constant CPU Usage

PostPosted: June 27th, 2018, 3:07 pm
by maros.beno
Hi,
sorry to hear you have such problems. Does this happen to you only in one particular PHP project, or in every PHP project, even the empty ones just created? If it's only one particular project, could you send it to us for analysis? It's sufficient to remove everything to the point that it's still happening, so we can reproduce it.

Thanks for the answer, have a nice day!

Re: Constant CPU Usage

PostPosted: June 27th, 2018, 4:21 pm
by metal450
Every PHP project, including empty ones I create from scratch.

Re: Constant CPU Usage

PostPosted: June 28th, 2018, 8:23 am
by maros.beno
Which version of PHP Tools and Visual Studio do you have? Also, could you send us Visual Studio ActivityLog please?

Thanks, have a nice day.

EDIT: https://docs.devsense.com/troubleshooti ... itylog-xml

Re: Constant CPU Usage

PostPosted: June 28th, 2018, 8:32 am
by metal450
PHP.VS.1.28.10848.2017

Visual Studio 15.5.3

To send you an ActivityLog, I should devenv.exe /log, then just quit VS & send you the log? Or I need to create a new php project, etc?

Re: Constant CPU Usage

PostPosted: June 29th, 2018, 8:35 am
by Miloslav Beno
Hello,

Yes, you will start the VS wtih log parameter (see https://docs.devsense.com/troubleshooting/activitylog-xml) and then open the project that caused the issue. After that the log should have some useful info which we can analyse.

Thanks!

Re: Constant CPU Usage

PostPosted: June 30th, 2018, 2:30 am
by metal450
While starting to skim through the log & playing with VS a bit, I figured out what's causing this: it appears PHP Tools doesn't like that I have devenv.exe firewalled. My firewall blocks it from talking to anyone except localhost, LAN, & a few specific remote servers (i.e. to block Microsoft's telemetry or any other kind of phone-home stuff I'm not interested in having). As soon as I disabled the firewall, the CPU usage dropped...& now even when I re-enable it, for the moment usage remains normal. So the plus side is it's fixed (for the moment), the minus side is I can on longer reproduce it (for the moment). However, maybe based on this you can figure out what's going on. Is PHP Tools trying to do some sort of 'phone home' or other network activity, which may be looping/repeating if VS does have an internet connection, but just can't reach some specific server? That's my best guess.

Re: Constant CPU Usage

PostPosted: July 4th, 2018, 8:21 am
by Miloslav Beno
Hello,

Thank you for great observations. With this information we will try to reproduce this. There might be some telemetry thing or license check or if it's not us, it can be something else because of us. Let us check that and get back to you as soon as we know more.

Thanks!

Re: Constant CPU Usage

PostPosted: July 21st, 2018, 11:21 pm
by metal450
Are we near a solution on this? I have to keep disabling my firewall anytime I develop in PHP (which is obviously not the best idea) - and sometimes when I forget to turn it off, I end up slurping through half a battery before I notice/remember.

Re: Constant CPU Usage

PostPosted: July 24th, 2018, 8:05 am
by maros.beno
Hi, I managed to reproduce your problem. But it was without any PHP Tools installed. Visual Studio just does not like to be offline I guess. When i was offline and turned on Visual Studio, CPU usage was about 80%, but when i enabled internet connection for a while, CPU usage dropped and then I could be offline again without much CPU usage. I don't think there's a way around it now, because it's Visual Studio itself doing this.