soyuka / pidusage

Cross-platform process cpu % and memory usage of a PID
MIT License
512 stars 55 forks source link

Wrong CPU usage #41

Closed sdellava closed 7 years ago

sdellava commented 7 years ago

Hi Devs, I've guess the CPU usage shown in the bottom of the IOTA Windows Wallet is not correct.

It use this module to get data to display.

It is almost the double of the value reported by the System monitor. Memory usage will also display the RSS only.

As you can see in this screenshot the wallet says 70% and the real value is 37%

image

Even momory seems not correct

soyuka commented 7 years ago

40

soyuka commented 7 years ago

I'm using https://technet.microsoft.com/en-us/library/ee176718.aspx which states:

For each process in the collection, calculate the total processor use.

  • Add the values for KernelModeTime and UserModeTime.
  • Together, KernelModeTime and UserModeTime tell you the total amount of processor time allocated to a process. To ensure that these values are added and not concatenated, use the VBScript function CSng to convert the variant data to the single data type.
  • Divide the combined value by 10,000,000. Processor use times are reported in 100-nanosecond increments. (A nanosecond is one-billionth of a second; 100 nanoseconds equal one ten-millionth of a second.) This calculation results in processor use being reported in seconds.

Memory is using the workingsetsize.

In your screenshot, you're showing the total cpu usage not the process one no?

sdellava commented 7 years ago

It should be the total. I'm a user, not the dev.

Anyway. Even if it is the process CPU it is wrong.

soyuka commented 7 years ago

It should be the total. I'm a user, not the dev.

I'm sorry I'm not the dev of the IOTA Wallet therefore I can't help you to get the total cpu usage. I'll try to see if someone there has more informations to give me.

Anyway. Even if it is the process CPU it is wrong.

Maybe it is, but by saying so you're not helping to resolve the issue.

soyuka commented 7 years ago

May you give me the windows version you're currently on? Thanks.

soyuka commented 7 years ago

Bad usage in the given software. Fix: https://github.com/iotaledger/wallet/pull/175

sdellava commented 7 years ago

here the windows version details:

image

soyuka commented 7 years ago

Your issue is fixed in my PR of the software project. Thanks anyway!