notepad-plus-plus / notepad-plus-plus

Notepad++ official repository
https://notepad-plus-plus.org/
Other
22.65k stars 4.58k forks source link

High sihost.exe CPU use only while Notepad++ is open #14548

Open jabcreations opened 8 months ago

jabcreations commented 8 months ago

Description of the Issue

Using an AMD 3800X the sihost.exe file is reporting 5% CPU usage while my system is idle. Manually closing programs revealed that Notepad++ is consistently the culprit. I should note that it did not properly restore my last session after right-clicking the panel on the taskbar to close it to confirm this. Opening different files may or may not trigger this (i.e. this may be related to a subsection such as the functions list.

Steps to Reproduce the Issue

I do not know how to reproduce the issue specifically. About 95%+ of the files I edit are CSS, JavaScript and PHP.

Expected Behavior

I expect a text editor, even a very advanced one, to not to act like it's single-handedly conducting Beethoven's Symphony number 7 in the background.

Actual Behavior

Nothing from a GUI/UI/UX perspective; I just watch the Task Manager like a hawk.

Debug Information

Notepad++ v8.6 (64-bit) Build time : Nov 23 2023 - 16:58:44 Path : C:\MEDIA\OFFICE\Notepad++\notepad++.exe Admin mode : ON Local Conf mode : OFF Cloud Config : OFF OS Name : Windows 10 Pro (64-bit) OS Version : 22H2 OS Build : 19045.3570 Current ANSI codepage : 1252 Plugins : DSpellCheck (1.5) mimeTools (2.9) NppConverter (4.5) NppExport (0.4)

xomx commented 8 months ago

I have never experienced something like this on my computers (Win8.1,10,11) but saw people having something similar with other apps and the sihost: https://www.technewstoday.com/shell-infrastructure-host-high-cpu-usage/

I should note that it did not properly restore my last session after right-clicking the panel on the taskbar to close it to confirm this.

Sorry, I do not follow, could you elaborate?

dcog989 commented 8 months ago

I noticed a week ago that Settings... Preferences... Backup... Backup in every X seconds was set to 7! I don't know how or when that was set but it might explain the 88% life expectancy of my NVME!

Worth checking even if not the cause of your sihost issue....

alankilborn commented 8 months ago

@dcog989 FYI: Backup only occurs if something has changed in the last 7 secs.

dcog989 commented 8 months ago

@dcog989 FYI: Backup only occurs if something has changed in the last 7 secs.

Really? Then the text for that setting really needs some clarification.

alankilborn commented 8 months ago

Then the text for that setting really needs some clarification.

And your suggestion is...?

Backup (at most) | 7 | seconds after change

??

alankilborn commented 8 months ago

BTW, the user manual is reasonably clear on this point:

This will auto-save your changed file once every N seconds to the listed directory

to be interpreted as: "If your file is not changed, there is no save"

alankilborn commented 8 months ago

@dcog989 The maintainer of the user manual @pryrt has agreed to make the user manual even more explicit, for you and others like you.

dcog989 commented 8 months ago

@alankilborn

If a user needs to go hunting for a manual to understand a very simple setting like this, then it is very obviously a failure of the description within settings. Only a tedious half wit would blame the user and tell them to go RTFM.

There is no mention of the key condition "if file has been changed". You don't need to be a genius to work out what the solution is here. But as it has eluded you, I have raised the ticket - https://github.com/notepad-plus-plus/notepad-plus-plus/issues/14560

alankilborn commented 8 months ago

Only a tedious half wit

The same could be said for someone that would think a file that hasn't changed (since the last change) would trigger a new pointless backup. The original wording was never questioned because there was no need to say "if files have changed".

jabcreations commented 8 months ago

I like to presume that users have a 3/10 comprehension when approaching software.

Any way, two screenshots from Process Explorer with two of the what I feel are more relevant tabs:

1 2

So...should there be 105 trillion cycles? 🤨︀

I'm less certain about the connection to Notepad++ though this seems to calm down after closing it so... 🤷

xomx commented 8 months ago

@jabcreations npp-sihost-high-cpu-callstack

jabcreations commented 8 months ago

I waited a moment for the one that seemed to stick out (TID 19432, at the top) and went in to it's stack:

stack

I don't see anything other than Windows specific processes as far as I can determine. What else can I do to figure what is going on?

xomx commented 8 months ago

@jabcreations Maybe the callstack frame 11 shown (setjmpex) is a sign of some exception.

You can try to create the sihost process snapshot via the Process Explorer (rightclick sihost.exe > Create Dump > Create Minidump...), zip the dmp-file created and post it here for analysis.

dcog989 commented 8 months ago

@alankilborn

We get it. You blame the user regardless of any other facts, in some desperate and failed effort to appear superior to everyone else.