Go Down

Topic: IDE causes high cpu / fan usage (Read 9693 times) previous topic - next topic

ballscrewbob

#60
Oct 29, 2018, 02:28 pm Last Edit: Oct 29, 2018, 02:56 pm by ballscrewbob
A few possible interesting side notes here.

(1) Just took a JAVA update and did some similar tests to those I did for YT.
The spikes were noticeably less.

(2) Using 1.8.7 from an UNZIPPED location (no change to prev version)

(3) security ON (AVAST, MBAM and Defender)

(4) Also the "resting" state for JAVAW.EXE for the CPU's seems more consistent here at around 3% but peaking now at 25% for a compile.

(5) The Java update "seems" to have impacted the initial compile time (increase) but doing a full clean up cured that.

( 6 ) The IDE does seem to SIT in a state of readiness for COMPILE or SAVE (as noted).

( 7 ) Cannot now peak above 70% even with security enabled (decreased peak)

( 8 ) Cannot get it to spike or raise its resting state (approx 3%) once a save or period of idle has been achieved certainly not "randomly" anyway.

EDIT:

For less serious users who might come up against this issue there is always the CREATE EDITOR.
This takes a considerable load OFF your computer and places it on the Arduino servers.
A short test indicates this can take as much as 80% (best guesstimate) of any load you might see and free up valuable resources on your computer.


It may not be the answer you were looking for but its the one I am giving based on either experience, educated guess, google or the fact that you gave nothing to go with in the first place so I used my wonky crystal ball.

westfw

Quote
Just took a JAVA update
Doesn't the Arduino IDE include its own copy of Java, since about 1.0.6 or so?  Are there circumstances under which the system Java gets used instead of the private copy?

ballscrewbob

@westfw

Thought that was the case too, but not 100% sure anymore since there does seem to be a correlation between this update and what I can see on the process monitor across all four cores.
It may not be the answer you were looking for but its the one I am giving based on either experience, educated guess, google or the fact that you gave nothing to go with in the first place so I used my wonky crystal ball.

MatthewDriver

Westfw, thanks for giving me a nudge in the right direction!

I had a look, and the Arduino IDE contains  \java\bin\javaw.exe

Compiling a list of java versions supplied with IDE versions reveals that IDE 1.8.6 and 1.8.7 share the same version of java.
 
Arduino IDE version: 1.8.1
javaw.exe version: 8.0.1110.14

Arduino IDE version: 1.8.5
javaw.exe version: 8.0.1440.1

Arduino IDE version: 1.8.6
javaw.exe version: 8.0.1710.11

Arduino IDE version: 1.8.7
javaw.exe version: 8.0.1710.11

Arduino IDE version: beta 1.9
javaw.exe version: 8.0.1910.12

Arduino IDE version: Current hourly build
javaw.exe version: 8.0.1910.12


I then copied the java folder from IDE BETA 1.9 into the IDE 1.8.7 install folder and the fault is gone!

As a double check, I copied the java from 1.8.7 into beta 1.9 and the fault shows up in beta 1.9.

My conclusion is that the java supplied with Arduino IDE 1.8.6 and 1.8.7 (java version 8.0.1910.12) is the cause of the 30% CPU utilisation issue that some of us have seen.

SOLUTION:
You can run Arduino IDE 1.8.7 successfully simply by replacing the java folder, using the Arduino Beta 1.9 install as the source.

Does anyone (that has seen this fault before) care to test and confirm or deny this theory?

Cheers,

Matthew.

westfw

Quote
When the Windows Arduino IDE is running, the javaw.exe uses approximately 35% CPU usage.
If left unattended, it will never drop.

The high CPU can be stopped by click File\Save (discovered by WacKEDmaN).
The high CPU can be started by click moving or resizing the Arduino IDE window.
Nice work isolating this!
I can duplicate the problem in the free "virgin" W10 VM from https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/ after doing nothing but installing 1.8.7 (except that I see about 40% utilization.)

Coding Badly


From what I can tell the Arduino IDE could be packaged to use a system installed Java, with a minimum version, or the bundled Java.  This computer has a 64 bit Java installed (and I'm not going to replace that) so I cannot test if that works.  The test is trivial: rename the "java" folder that is in the same directory as "arduino.exe".  If the IDE runs, it used the system installed Java.  Otherwise an error is displayed.

The advantage to using a system installed Java is it is easier to ensure it is up-to-date.


MatthewDriver

Hi Coding Badly,


What you say makes sense.


I'm using the portable Arduino IDE install and your method proves it relies on the java in the IDE folder (not the system java).

If I rename the java folder I get the error: "The application was configured to use a bundled Java Runtime Environment but the runtime is missing or corrupted".

This may explain why most people don't see this bug. It is isolated to portable installs.

Cheers,

Matthew.


ballscrewbob

#67
Oct 30, 2018, 01:32 pm Last Edit: Oct 30, 2018, 01:33 pm by ballscrewbob
Karma for Mathews dogged persistence in chasing this.

If I rename the java folder (as suggested by CB) I can force the error he sees.

EDIT:
Multiple instances of IDE's installed here just to add context.



It may not be the answer you were looking for but its the one I am giving based on either experience, educated guess, google or the fact that you gave nothing to go with in the first place so I used my wonky crystal ball.

Coding Badly

If I rename the java folder I get the error...
I suspect because of the way the package is bundled ("use system Java" disabled).

If I have time I'll do more investigating.


westfw

Quote
This may explain why most people don't see this bug. It is isolated to portable installs.
No; the VM testing I did used a normal install.  Normal installs still use the bundled Java.

ballscrewbob

That doesn't really explain why I see a marked lowering of CPU usage with the IDE since the JAVA update.

Just more questions  :-\
It may not be the answer you were looking for but its the one I am giving based on either experience, educated guess, google or the fact that you gave nothing to go with in the first place so I used my wonky crystal ball.

Coding Badly

#71
Oct 31, 2018, 10:01 am Last Edit: Oct 31, 2018, 10:02 am by Coding Badly

I believe this is the section of interest...
https://github.com/arduino/Arduino/blob/ee1967cd530ceb9a1d638875e385157e90d532e8/build/windows/launcher/config.xml#L57-L68

Documentation is here...
http://launch4j.sourceforge.net/docs.html#Configuration_file

I suspect setting bundledJreAsFallback = true and minVersion to an appropriate value will result in the system Java being used in favour of the embedded version.


swilkens

#72
Oct 31, 2018, 08:47 pm Last Edit: Nov 03, 2018, 11:06 pm by ballscrewbob
Stopping and starting:
The high CPU can be stopped by click File\Save (discovered by WacKEDmaN).
The high CPU can be started by click moving or resizing the Arduino IDE window.

Anyone that already his this fault is welcome to reproduce these finding and confirm it or provided an alternate view.
I can confirm this behavior on IDE 1.8.7 on windows 8.1 and windows 10 enterprise, virgin installs (no system java). Using the non-portable version, so this is certainly not isolated to portable installs.

I can also confirm that replacing the 1.8.7 "java" folder with the java folder from 1.8.5 removes the issue completely on both machines.

It seems likely that this issue is related to the bundled javavm. Others with a seperate JRE installed might not see this if the clients falls over to a system-provided jvm through PATH?

Great work isolating this issue.

I found a related issue report on Github:

https://github.com/arduino/Arduino/issues/8009
Quote
Closing as fixed by updating bundled JREs

WacKEDmaN

Westfw, thanks for giving me a nudge in the right direction!

I had a look, and the Arduino IDE contains  \java\bin\javaw.exe

Compiling a list of java versions supplied with IDE versions reveals that IDE 1.8.6 and 1.8.7 share the same version of java.
 
Arduino IDE version: 1.8.1
javaw.exe version: 8.0.1110.14

Arduino IDE version: 1.8.5
javaw.exe version: 8.0.1440.1

Arduino IDE version: 1.8.6
javaw.exe version: 8.0.1710.11

Arduino IDE version: 1.8.7
javaw.exe version: 8.0.1710.11

Arduino IDE version: beta 1.9
javaw.exe version: 8.0.1910.12

Arduino IDE version: Current hourly build
javaw.exe version: 8.0.1910.12


I then copied the java folder from IDE BETA 1.9 into the IDE 1.8.7 install folder and the fault is gone!

As a double check, I copied the java from 1.8.7 into beta 1.9 and the fault shows up in beta 1.9.

My conclusion is that the java supplied with Arduino IDE 1.8.6 and 1.8.7 (java version 8.0.1910.12) is the cause of the 30% CPU utilisation issue that some of us have seen.

SOLUTION:
You can run Arduino IDE 1.8.7 successfully simply by replacing the java folder, using the Arduino Beta 1.9 install as the source.

Does anyone (that has seen this fault before) care to test and confirm or deny this theory?

Cheers,

Matthew.
nice find!..i updated the java in arduino folder and now 0-0.5% background usage and fans nice and quiet :)

shoo

I was having this exact problem, thanks for the work sleuthing this one! Just wanted to say that I updated to the Arduino IDE v1.8.8, which seems to have fixed this issue as well.

Go Up