On 2020/4/28 3:40, Abby Spurdle wrote:>>> (3) If (2) true, how much CPU is R using? >> 0%. > >>> (4) If (3) is zero, what processes are using the CPU the most? >> In such case, almost every processes is using the CPU in a very low >> percentage, i.e., 1% or below. I don't recognized those processes. >> Now, I invoke help.start(), about 25% of CPU loading is used by R. Quit >> from R, the CPU loading go back to idle. > > Is R using 0% or 25%? > > Again, if R was using 25% while showing the prompt and waiting for > user input, that would be a bug in R.25% CPU is used by R. And R shows the prompt and waits for user input. Here is a report of the CPU usage by Rgui from Windows command line: C:\Users\Jinso>typeperf "\Process(Rgui)\% Processor Time" -si 5 .... "04/28/2020 13:31:05.895","-1" "04/28/2020 13:31:10.915","0.622494" "04/28/2020 13:31:15.925","0.000000" "04/28/2020 13:31:20.935","0.000000" "04/28/2020 13:31:25.945","0.000000" "04/28/2020 13:31:30.965","2.801177" "04/28/2020 13:31:35.975","37.418638" "04/28/2020 13:31:40.982","100.159072" "04/28/2020 13:31:45.987","99.887614" "04/28/2020 13:31:50.992","99.899896" "04/28/2020 13:31:55.999","119.270784" "04/28/2020 13:32:01.002","299.014789" "04/28/2020 13:32:06.007","299.666184" "04/28/2020 13:32:11.015","294.905707" "04/28/2020 13:32:16.019","299.755921" "04/28/2020 13:32:21.025","299.924392" "04/28/2020 13:32:26.030","296.594191" "04/28/2020 13:32:31.048","298.195791" "04/28/2020 13:32:36.054","292.362986" "04/28/2020 13:32:41.064","292.503832" "04/28/2020 13:32:46.068","301.650976" ... ... At about 10", I start Rgui, the CPU usage is about 0.5~1% (The second column number may be divided by 4). At about 35", I call help.start() from menu of Rgui, you may notice that CPU usage increased to about 25%. At about 55", I click on the ``Packages'' link in the browser. The CPU usage increased to about 70-75%, and closing browser does not have any effects on the CPU usage of R.> > Or do you mean R is using 0% and total CPU usage *temporarily* > increases 25% *while* R is running? > If so, this could be the result of some security feature...? not sure > because this is outside my area... > > I just found the following feature. > If you open powershell, one can run: ps | sort -desc cpu > > This could be used if you want to show people what's happening. > > PS C:\Users\spurdle> ps | sort -desc cpu > > Handles NPM(K) PM(K) WS(K) CPU(s) Id SI ProcessName > ------- ------ ----- ----- ------ -- -- ----------- > 625 28 108940 111644 4,900.52 8176 0 audiodg > 794 38 234888 177924 62.13 8652 19 chrome > 1673 71 84372 147628 61.97 10304 19 chrome > 330 25 100096 146968 55.80 1052 19 chrome > 391 26 141928 181264 35.27 6884 19 chrome > 291 20 46676 80472 15.25 5352 19 chrome > 2351 79 58404 107276 13.33 6940 19 explorer > 443 22 17916 34764 12.17 7196 19 chrome > 1331 90 107628 87596 10.86 9432 19 SearchUI > 671 41 56184 70320 9.94 10420 19 powershell > 362 24 51984 91568 9.06 4360 19 chrome > 1129 107 206988 31852 7.17 6740 19 SkypeApp > 696 40 26764 45620 5.33 4348 19 > Lenovo.Modern.ImController.PluginHost.Device > 256 20 56860 84372 5.17 1660 19 chrome > 284 18 34532 62112 5.13 1212 19 chrome > 291 19 7048 16360 4.30 1476 19 chrome > > Diverging, I can't figure out how to permanently stop Lenovo and Skype > processes, or why chrome (and edge) need so many copies of > themselves... > Anyway, the plan is to shift to Debian or OpenIndianna, and run > ReactOS via virtualization... >
I also test the same operations on R 3.6.3. The CPU usage does not change dramatically. C:\Users\Jinso>typeperf "\Process(Rgui)\% Processor Time" -si 5 ... "04/28/2020 13:42:41.007","-1" "04/28/2020 13:42:46.017","-1" "04/28/2020 13:42:51.037","0.622240" "04/28/2020 13:42:56.048","0.000000" "04/28/2020 13:43:01.058","1.871148" "04/28/2020 13:43:06.069","3.436832" "04/28/2020 13:43:11.079","0.000000" "04/28/2020 13:43:16.099","0.000000" "04/28/2020 13:43:21.109","0.000000" "04/28/2020 13:43:26.119","3.432397" "04/28/2020 13:43:31.129","0.000000" "04/28/2020 13:43:36.139","0.935587" "04/28/2020 13:43:41.149","0.933886" "04/28/2020 13:43:46.168","1.244979" "04/28/2020 13:43:51.188","4.054443" "04/28/2020 13:43:56.209","0.000000" "04/28/2020 13:44:01.239","0.310505" ... At 51", start Rgui, and 06" call help.start() from menu of Rgui, click on the ``Packages'' link, close browser, and so on. You may notice that there are no high CPU usage occurred. Seems a bug in R 4.0.0... Best, Jinsong On 2020/4/28 13:39, Jinsong Zhao wrote:>> Again, if R was using 25% while showing the prompt and waiting for >> user input, that would be a bug in R. > > 25% CPU is used by R. And R shows the prompt and waits for user input. > > Here is a report of the CPU usage by Rgui from Windows command line: > C:\Users\Jinso>typeperf "\Process(Rgui)\% Processor Time" -si 5 > .... > "04/28/2020 13:31:05.895","-1" > "04/28/2020 13:31:10.915","0.622494" > "04/28/2020 13:31:15.925","0.000000" > "04/28/2020 13:31:20.935","0.000000" > "04/28/2020 13:31:25.945","0.000000" > "04/28/2020 13:31:30.965","2.801177" > "04/28/2020 13:31:35.975","37.418638" > "04/28/2020 13:31:40.982","100.159072" > "04/28/2020 13:31:45.987","99.887614" > "04/28/2020 13:31:50.992","99.899896" > "04/28/2020 13:31:55.999","119.270784" > "04/28/2020 13:32:01.002","299.014789" > "04/28/2020 13:32:06.007","299.666184" > "04/28/2020 13:32:11.015","294.905707" > "04/28/2020 13:32:16.019","299.755921" > "04/28/2020 13:32:21.025","299.924392" > "04/28/2020 13:32:26.030","296.594191" > "04/28/2020 13:32:31.048","298.195791" > "04/28/2020 13:32:36.054","292.362986" > "04/28/2020 13:32:41.064","292.503832" > "04/28/2020 13:32:46.068","301.650976" > ... > ... > > At about 10", I start Rgui, the CPU usage is about 0.5~1% (The second > column number may be divided by 4). > > At about 35", I call help.start() from menu of Rgui, you may notice that > CPU usage increased to about 25%. > > At about 55", I click on the ``Packages'' link in the browser. The CPU > usage increased to about 70-75%, and closing browser does not have any > effects on the CPU usage of R. > >
> > Again, if R was using 25% while showing the prompt and waiting for > > user input, that would be a bug in R. > > 25% CPU is used by R. And R shows the prompt and waits for user input. > > Here is a report of the CPU usage by Rgui from Windows command line: > C:\Users\Jinso>typeperf "\Process(Rgui)\% Processor Time" -si 5 > .... > "04/28/2020 13:31:05.895","-1" > "04/28/2020 13:31:10.915","0.622494"I'm not sure how to interpret this. And I don't see where you get the 25% from. I was suggesting something resembling the top command. (Re-iterating, I misinterpreted the ps command).
On 2020/4/28 15:44, Abby Spurdle wrote:>>> Again, if R was using 25% while showing the prompt and waiting for >>> user input, that would be a bug in R. >> >> 25% CPU is used by R. And R shows the prompt and waits for user input. >> >> Here is a report of the CPU usage by Rgui from Windows command line: >> C:\Users\Jinso>typeperf "\Process(Rgui)\% Processor Time" -si 5 >> .... >> "04/28/2020 13:31:05.895","-1" >> "04/28/2020 13:31:10.915","0.622494" > > I'm not sure how to interpret this. > And I don't see where you get the 25% from.The number in second column divided 4 would give the CPU usage, so, if the number is 100 or above, then the CPU usage is 25% or more...> > I was suggesting something resembling the top command. > (Re-iterating, I misinterpreted the ps command).There are no ``top'' command on Windows. And I am not familiar with the command line utilities on Windows. Since I can not reproduce the same problem using R 3.6.3, I think it is a bug in R 4.0.0. I have filed a bug report. Thanks a lot for your help. Best, Jinsong