kefaslungu / resourceMonitor

Resource Monitor add-on for NVDA
GNU General Public License v2.0
13 stars 18 forks source link

Error while retrieving information about RAM #25

Closed VovaMobile closed 11 months ago

VovaMobile commented 11 months ago

A critical issue with the Resource Monitor addon vas detected. Version 23.10 does not show information about RAM and an error message appears in the NVDA log: ERROR - scriptHandler.executeScript (19:19:55.989) - MainThread (14984): error executing script: <bound method GlobalPlugin.script_announceRamInfo of GlobalPlugin ('globalPlugins.resourceMonitor')> with gesture 'shift+NVDA+2' Traceback (most recent call last):   File "scriptHandler.pyc", line 295, in executeScript   File "C:\Users\Acer\AppData\Roaming\nvda\addons\resourceMonitor\globalPlugins\resourceMonitor__init.py", line 411, in script_announceRamInfo     virtualRam = list(psutil.swap_memory())   File "C:\Users\Acer\AppData\Roaming\nvda\addons\resourceMonitor\globalPlugins\resourceMonitor\psutil\init__.py", line 1992, in swap_memory     return _psplatform.swap_memory()   File "C:\Users\Acer\AppData\Roaming\nvda\addons\resourceMonitor\globalPlugins\resourceMonitor\psutil_pswindows.py", line 257, in swap_memory     percentswap = cext.swap_percent() RuntimeError: PdhAddEnglishCounterW failed. Performance counters may be disabled.

Previous versions (for example, 23.09) did not have this problem. NVDA version: 2023.3 Beta 4 Windows version: Windows 11 23H2 (AMD64) build 22631.2338

josephsl commented 11 months ago

Hi,

Can you try this build:

https://github.com/kefaslungu/resourceMonitor/releases/download/23.10/resourceMonitor-23.10.1.nvda-addon

If it resolves the issue, then we can go ahead and include this in 23.11.

Thanks.

VovaMobile commented 11 months ago

Hi, problem not resolved. ERROR - scriptHandler.executeScript (09:10:12.012) - MainThread (13496): error executing script: <bound method GlobalPlugin.script_announceRamInfo of GlobalPlugin ('globalPlugins.resourceMonitor')> with gesture 'shift+NVDA+2' Traceback (most recent call last): File "scriptHandler.pyc", line 295, in executeScript File "C:\Users\Acer\AppData\Roaming\nvda\addons\resourceMonitor\globalPlugins\resourceMonitor__init.py", line 411, in script_announceRamInfo virtualRam = list(psutil.swap_memory()) File "C:\Users\Acer\AppData\Roaming\nvda\addons\resourceMonitor\globalPlugins\resourceMonitor\psutil\init__.py", line 1995, in swap_memory return _psplatform.swap_memory() File "C:\Users\Acer\AppData\Roaming\nvda\addons\resourceMonitor\globalPlugins\resourceMonitor\psutil_pswindows.py", line 257, in swap_memory percentswap = cext.swap_percent() RuntimeError: PdhAddEnglishCounterW failed. Performance counters may be disabled.

josephsl commented 11 months ago

Hi, I see – I’m also noticing a slow down when obtaining memory information on my system. Looks like an error message may need to be added – I wonder if this issue is unique to your system or is experienced by others as well. Thanks.

josephsl commented 11 months ago

Hi,

Can you try the steps listed in giampaolo/psutil#2105? If it does not work, I'll provide a try build with psutil 5.9.4 downgrade to see if it resolves it.

Thanks.

VovaMobile commented 11 months ago

Unfortunately, I can't follow all the steps that are listed there. In particular, I don't have the files located on the installation disk in the i386 folder because the Windows 11 image doesn't have this folder.

josephsl commented 11 months ago

Hi,

I see. At least physical memory (RAM) values can be obtained, so I'll add a message about paging file (virtual memory) or simply not report virtual memory values.

In the menatime, can you try this try build:

https://github.com/kefaslungu/resourceMonitor/releases/download/23.10/resourceMonitor-23.10.2.nvda-addon

Thanks.

VovaMobile commented 11 months ago

Thanks, with this build all works correctly!

josephsl commented 11 months ago

Hi, do keep in mind that this is based on psutil 5.9.4, so this solution cannot be a long-term one. I will do something about virtual memory message and note in the readme about this problem. Thanks,