Arduino Forum

Using Arduino => Installation & Troubleshooting => Topic started by: DaveEvans on Jan 12, 2017, 09:26 pm

Title: IDE causes high cpu / fan usage
Post by: DaveEvans on Jan 12, 2017, 09:26 pm
Whenever I ran 1.6.5-r5, the cpu usage skyrocketed and the cooling fan ran at high speed.  Adding the Sparkfun FTDI seemed to make things worse.

I recently upgraded to 1.6.12 and have the same behavior.  Red arrows on the screenshot shows when the IDE was closed (FTDI not attached).

Windows 7 Home Premium 64-bit, 2.5 GHz i5 CPU, 6 GB RAM laptop.

Haven't found anything via Google re this problem.

Other than using the on-line IDE, is this fixable?

(http://forum.arduino.cc/index.php?action=dlattach;topic=447871.0;attach=194473)
Title: Re: IDE causes high cpu / fan usage
Post by: Coding Badly on Jan 12, 2017, 09:35 pm

Navigate to the Processes tab.  Sort by CPU.

What is first?

What is second?

Title: Re: IDE causes high cpu / fan usage
Post by: DaveEvans on Jan 12, 2017, 09:49 pm
The first is javaw.exe *32, and the second varies...taskmgr,firefox...
Title: Re: IDE causes high cpu / fan usage
Post by: Coding Badly on Jan 12, 2017, 10:01 pm

Odd.  Here the IDE never goes idle but it also never goes above about 2%; usually staying below 1%.

How does Physical Memory Usage look?  About in the middle?


Title: Re: IDE causes high cpu / fan usage
Post by: DaveEvans on Jan 12, 2017, 10:03 pm
Thanks.  Yup, physical memory is about in the middle.
Title: Re: IDE causes high cpu / fan usage
Post by: Coding Badly on Jan 12, 2017, 10:06 pm

Your computer is not much different than mine (Win 7 Pro, 64b, i7 @ 2.2 GHz, 8 GiB, laptop).

In Device Manager, how many serial ports are listed?

Title: Re: IDE causes high cpu / fan usage
Post by: DaveEvans on Jan 12, 2017, 10:13 pm
Two COM/LPT ports.
Title: Re: IDE causes high cpu / fan usage
Post by: Coding Badly on Jan 12, 2017, 10:40 pm

The only ideas I have (all shots in the dark)...

Use Performance Monitor to determine if the CPU is wasting time in the kernel or in the application.  If it is kernel time you may have failing hardware or a buggy kernel driver.

--OR--

Run the IDE under a debugger to determine what it is doing.

--OR--

Check the Java version (I don't know how to do that).

Title: Re: IDE causes high cpu / fan usage
Post by: DaveEvans on Jan 12, 2017, 10:45 pm
Hmmmmmmm... ok, thank you.   Will try to figure out how to do those things.

If you don't mind one more thing... if you go to Control Panel and view by small icons, click on Java, and then General tab -> About..., what do you see?  I have Version 7 Update 9  build 1.7.0_09-b05   
Title: Re: IDE causes high cpu / fan usage
Post by: ballscrewbob on Jan 13, 2017, 03:24 am
Better than the std process viewer is process explorer from MS HERE (https://technet.microsoft.com/en-us/sysinternals/bb896653)

It will show things you would not normally see.

Other reports concerning high CPU usage and Arduinos range from serial modems, bluetooth devices, Antivirus issues, other security software, Actual virus or malware, Other USB devices taking COM resources.
Title: Re: IDE causes high cpu / fan usage
Post by: DaveEvans on Jan 13, 2017, 08:03 am
Thank you - I'll try turning off the antivirus, for starters.
Title: Re: IDE causes high cpu / fan usage
Post by: DaveEvans on Jan 13, 2017, 08:18 am
All four processors are pegged at 100% after updating Java to the latest version and turning off anti-virus, so those two items are off the list.

Anything here look unusual?(http://forum.arduino.cc/index.php?action=dlattach;topic=447871.0;attach=194541)
Title: Re: IDE causes high cpu / fan usage
Post by: Coding Badly on Jan 13, 2017, 08:37 am

Open a command shell.  Run this...

set JAVA_HOME

Title: Re: IDE causes high cpu / fan usage
Post by: DaveEvans on Jan 13, 2017, 06:00 pm
will do when I get home from work...
Title: Re: IDE causes high cpu / fan usage
Post by: DaveEvans on Jan 14, 2017, 06:39 am
JAVA_HOME was not set.  I set it (and updated PATH) to point to the JRE.

CPU usage seems better, but it is still far above your 2%.

I (temporarily) set javaw.exe to run on one core, to be sure I was seeing the IDE, and took the following screenshot.  Usage hits 100% when compiling (horizontal red line).  Before and after, when I'm doing nothing with the IDE, it cycles as shown.  Drops to nothing when the IDE is closed (vertical red line).   Running on all cores...70-50% during compile.

I googled java high cpu usage windows 7 but found nothing definitive.

One good thing has come out of this: cleaning the fan ports helped reduce fan noise...(http://forum.arduino.cc/index.php?action=dlattach;topic=447871.0;attach=194636)
Title: Re: IDE causes high cpu / fan usage
Post by: Coding Badly on Jan 14, 2017, 07:58 am

Other than the time sponges  in reply #7 (http://forum.arduino.cc/index.php?topic=447871.msg3081876#msg3081876) I am out of ideas.

Title: Re: IDE causes high cpu / fan usage
Post by: DaveEvans on Jan 14, 2017, 08:04 am
Ok, thanks - I appreciate all the suggestions.  +1
Title: Re: IDE causes high cpu / fan usage
Post by: Coding Badly on Jan 14, 2017, 08:08 am

Well, there is one more thing...

Repeat this but click Show processes from all users...
http://forum.arduino.cc/index.php?topic=447871.msg3081763#msg3081763 (http://forum.arduino.cc/index.php?topic=447871.msg3081763#msg3081763)

Make certain Java*32 really is the culprit.

I should have had you do that the first time.

Title: Re: IDE causes high cpu / fan usage
Post by: DaveEvans on Jan 14, 2017, 07:09 pm
Yes, with "all users," javaw... is still at the top of the heap when the IDE is "just sitting there" (no editing, no compiling, no Boards Manager activity, no serial monitor, etc.)  During a compile, a few others briefly reach the top: arduino-builder, ld, extensa..., but javaw is at the top most of the time.
Title: Re: IDE causes high cpu / fan usage
Post by: RichardDL on Jan 28, 2017, 06:44 pm
I have just updated to 1.8.1 and I have the same problem.  I think it used to happen sometimes, but today it's all the time.  As soon as I start the IDE it goes to 42% CPU forever (both cores).  Even without any compile or upload, just leave the IDE sitting there.  Stop the IDE and immediately down to 2%.  I've been around this several times, completely sure it's the IDE doing it.  If I go in device manager and disable 'Bluetooth RFCOMM' and COM1, restart IDE, the CPU is only 18%.  I'd disable all the COM ports, but I need 1 for the Arduino.

I've seen a comment somewhere that there's 'port discovery' and that was/is the problem.  I've looked through all the preferences to see if there's anything that I can turn off, not found anything.

It's really annoying having the fan on full all the time, never mind the power consumption.  I hope someone has a workaround or even a full fix.
Title: Re: IDE causes high cpu / fan usage
Post by: ballscrewbob on Jan 28, 2017, 09:35 pm
Win 7 x64 pro on a quad core with IDE 1.8.1
here and just monitored the IDE start up.

Idling at 3% to start
Peaks up to 43% at one point briefly.
IDE fully up idles at 18% max
A Compile peaks at 24% but mostly in the 10-18 % range
Upload peaks at 35% but averages below 20%

Starting solataire peaks at 37% then averages17-20% unles left to idle just as an aside to those worried about consumption.

Whilst nor definitive in any way as each computer you all have will be using different confiurations of software and so subject to differing numbers.
Minor peaks are to be expected during some operations and nothing to be alarmed about.

For those that have consistent high CPU usage you may want to consider what else is running besides the IDE especially anything you dont know about.
Maybe start with a full clean up and security sweep. (dont just rely on whats already on your computer for these tasks)

Title: Re: IDE causes high cpu / fan usage
Post by: RichardDL on Jan 28, 2017, 09:54 pm
The cpu is at 2%, start the ide 30%, stop IDE 2%.  I've done that several times, it's clear to me the problem is the IDE.
Title: Re: IDE causes high cpu / fan usage
Post by: ballscrewbob on Jan 28, 2017, 10:19 pm
I cannot see all your running processes including any hidden ones.
I dont have a benchmark for your computer.
I havent done a security sweep (in depth) of your computer
Nor have I done a comprehensive cleanup for you.
Not being pedantic here just pointing out how hard it is to judge what is and isnt without all the details.
AFAIK 30% could be normal for your system Richard

Could you possibly do a basic speed test with NOVABENCH and post that here then do the following.

A restart between each step may be useful but usually only needed after running WISE

1. Remove any unwanted software and toolbars etc.
2. Go HERE (https://www.piriform.com/ccleaner/download) and get CCLEANER and install and run it once at its default settings. (get the free version)
3. Go HERE (http://www.wisecleaner.com/wise-registry-cleaner.html) and get WISE Registry cleaner and run it in DEEP SCAN and let it do its thing.
4. Run CCLEANER again.
5. Restart the computer.

Re-do the speed test and post it.

The next section is up to you but I do reccomend it when I see consisten high CPU usage for no real reason.

a. Run the ESET online scanner (https://www.eset.com/us/home/online-scanner/) until completion and fix any issues it may find.
b. Install Superantispyware (http://www.superantispyware.com/download.html) and run it and fix any issues it may find (FREE version)
b. Download and run MBAM (https://www.malwarebytes.com/mwb-download/) and fix any issues that may find (free version)
c. Run CCLEANER then WISE REG cleaner and restart.

Redo the speed test and post it.

Title: Re: IDE causes high cpu / fan usage
Post by: RichardDL on Jan 28, 2017, 10:52 pm
I think you haven't thought sufficiently about my last post.  Without the IDE running the computer is using 2%.  I hate repeating myself, but when I start the IDE it goes to 30%, and if I had all the com ports enabled it would be 40%.
Title: Re: IDE causes high cpu / fan usage
Post by: ballscrewbob on Jan 28, 2017, 10:56 pm
I think I did which is why I was so specific.

The IDE is not the only thing that uses JAVA on a computer and I was looking to rule out other stuff but hey guess I should not have bothered.

Java itself is not immune to nasties either but I woudnt know that.
Title: Re: IDE causes high cpu / fan usage
Post by: RichardDL on Jan 28, 2017, 11:11 pm
I have the IDE's javaw process suspended now, and the fan is quiet.  I'm using an external editor and thinking about unsuspending for compile+upload, maybe I can automate that.
Title: Re: IDE causes high cpu / fan usage
Post by: ballscrewbob on Jan 29, 2017, 06:07 am
Another real easy one with higher than average CPU fan usage is dust bunnies.
Just throwing that one out there.
Title: Re: IDE causes high cpu / fan usage
Post by: RichardDL on Feb 07, 2017, 11:16 pm
I still have this problem on 1 PC. Others I've looked at are alright, including one that is nominally the same as the one with the problem.  I suspect it depends on what com ports exist.
Title: Re: IDE causes high cpu / fan usage
Post by: ballscrewbob on Feb 08, 2017, 01:08 am
So what did you do to bring down the usage and is on a desktop or a lappy ?
Title: Re: IDE causes high cpu / fan usage
Post by: RichardDL on Feb 04, 2018, 06:21 pm
I'm bumping this thread because the issue is still annoying.  I have this on 2 PCs now, and another 2 are alright.  Of the 4, 3 are almost the same model.  All updated to 1.8.5.

I said in an earlier post that it's worse with more COM ports, and I've looked in Process Monitor: It's constantly reading registry keys about the com port properties.

Does anyone know how to turn this port-scan-rate down?
Title: Re: IDE causes high cpu / fan usage
Post by: ballscrewbob on Feb 04, 2018, 07:36 pm
Currently have 14 boards LIVE COM PORTS on one box including a GRBL based CNC machine pouring it heart out over serial at the fastest rate it can.
Other boxes too dont show signs of issues here either.

That doesnt help you I know but it does add a little context to serial port usage.

I am pretty sure it is something very specific to your set ups.
Be that security or some other policy I am not sure.
With so many boxes available it may well be worth setting up a full admin  profile on one (or using the hidden admin account) without any forms of security or other restrictions to see if that helps at all.



Title: Re: IDE causes high cpu / fan usage
Post by: Oldschool_Tubes on Jun 17, 2018, 01:40 pm
Hello Makers,

I had the same Issue with newer versions of the IDE.
Processes with High CPU load were javaw.exe and services.exe.  
After some hours and this thread I found a solution for me.

I had a COM-Port not listet in the Device Manager in Ports (COM & LPT) but it shows up in the IDE and hterm and when you execute in the command line:

reg query HKLM\hardware\devicemap\serialcomm

The IDE tried to scan it over and over.

In my case it was a modem.
Bluetooth devices or Hardlocks can also register as COM-Ports.

After deactivating the modem in Device Manager everything works fine and the COM port is not showing up anymore.

Im unter IDE 1.8.3 and WinXP, Java 8 Build 151.
Title: Re: IDE causes high cpu / fan usage
Post by: swilkens on Oct 12, 2018, 08:09 pm
Adding to this, I see similar behavior as Oldschool_Tubes. Created an account to post my findings, though I've been using the IDE since 1.0.

Windows: 8.1
Arduino IDE: 1.8.7

Opening the IDE:

(https://i.imgur.com/bZejIoB.png)

Overview of processes showing Java thread being the culprit and Arduino IDE being the only Java process:
(https://i.imgur.com/RZ0pMmR.png)

Closing the IDE:
(https://i.imgur.com/NuH6hDG.png)
Title: Re: IDE causes high cpu / fan usage
Post by: ballscrewbob on Oct 16, 2018, 03:04 pm
Laptops dont set a good precedent except against other laptops.

Nor does the slower CPU used in your tests.

Useful information for some maybe.



Title: Re: IDE causes high cpu / fan usage
Post by: WacKEDmaN on Oct 17, 2018, 02:53 am
same issues here..the IDE if left running for a while will max out 1 CPU core (on quad core system)..and not goto idle until the process is terminated..this pushes up both temps and fan speed/fan noise

this is defiantly an IDE issue..nothing to do with antivirus, or dustbunnys or any of that BS that screwballbob suggests...its an error in the IDE coding as it never used to do it with an older version (1.8.4 iirc) of the IDE...
Title: Re: IDE causes high cpu / fan usage
Post by: ballscrewbob on Oct 17, 2018, 03:03 am
OK I will bite LOL


1. NEVER MENTIONED "dustbunnys" (that came from left field like your whole comment) ;)

2. AV has been proven over and over again to reduce speed of compiles but don't take my word for it do your own search.

3. Quad here and don't see those types of results. However I do keep a lean system that many don't.

My "BS" as you put it is based on enough experience to know a little different to your banal statement.


Title: Re: IDE causes high cpu / fan usage
Post by: WacKEDmaN on Oct 17, 2018, 08:06 am
Another real easy one with higher than average CPU fan usage is dust bunnies.
Just throwing that one out there.

just to refresh your memory...

im not talking about compiling or anything like that....im talking about the IDE just sitting there in the background being open.... leave it running on your system for 24hrs or more and watch the 100% core usage for yourself..

currently after restarting the IDE its sayin 0% while its in the background.....ill leave it open for the night and show that its maxing out one core...
Title: Re: IDE causes high cpu / fan usage
Post by: ballscrewbob on Oct 17, 2018, 02:11 pm
My apology I missed that.  :-[
However it is more than a valid point, more so on a laptop with such limited space and airflow.

At this side I can PEAK the usage during a compile start to around 50% for a very short period.
But this is a full box not a lappy.

Good edit btw I was looking for that IDE version you originally quoted.





Title: Re: IDE causes high cpu / fan usage
Post by: WacKEDmaN on Oct 17, 2018, 03:35 pm
less than 24hrs later...
(https://i.imgur.com/sCeUUlk.png)

IDE has just been sitting there in the background for the last 3hrs (been running for about 12hrs..disregard the info in the status, that compile was done about 3hrs previous)..usage was 0% when i left it...then all of a sudden i notice fans spin up and never spin down...and its maxing out a core..

this is also a full desktop system..not a laptop...
Title: Re: IDE causes high cpu / fan usage
Post by: ballscrewbob on Oct 17, 2018, 03:39 pm
Odd that its just one core as mine spreads the load out across all four.

AMD bulldozer here at 3.5 GHz (yes its old)

Have you optimised your cores ?

EDIT

Also win 7x64 pro not the resource hungry win 10 ;)
Not fired up my 10 test box.
See you still have some of the win 10 bloatware running too  :smiley-eek:
Title: Re: IDE causes high cpu / fan usage
Post by: WacKEDmaN on Oct 17, 2018, 04:20 pm
always uses one core...always has..it'll use more cores during compilation..but the IDE itself has only ever used one core
on intel here...
never heard of optimizing cores (and i do pc repairs on both software and hardware sides for a living)..do tell more...i cant find anythin on google even...
all my other apps that are multi threaded work perfectly fine...without "optimized cores"


if the IDE is doing this on single core cpu...it would be taxing the whole system, probably locking it up entirely

system specs which may or may not help
intel i5-750 @ 3.4ghz (yes old but only just starting to show its age in latest games)
16Gb DDR3 1333
gtx760
ample hdd space

btw what would you consider bloatware from whats shown in my taskman list? dont say the anti malware service exe...its what i choose to use after finding every other antivirus software on the market slows the system even more than M$s antivirus
Title: Re: IDE causes high cpu / fan usage
Post by: ballscrewbob on Oct 17, 2018, 04:35 pm
Odd that you have never optimized processes for CPU's as I too have a little over 30 years in IT including roll outs for such as Home Hardware, on call etc etc etc.

Google found plenty of hits BTW (https://www.google.ca/search?q=optimize+cores&rlz=1C1NHXL_enCA761CA762&oq=optimize+cores&aqs=chrome..69i57.7544j1j8&sourceid=chrome&ie=UTF-8)

Specs look fine.

But lets be fair here we both have different hardware and as IT people we both know full well that even two similar systems can perform completely different in the field.

We also both know from being in IT that some programs are set up well OOB for multi core and others are not and may need assistance.

EDIT bloatware "CORTANA" for one is not needed on a lean system. There are hundreds of topics about streamlining win 10 for better response times that I am sure you are aware of.

EDIT 2  No doubt you have seen the black viper stuff (http://www.blackviper.com/service-configurations/black-vipers-windows-10-service-configurations/) but JIC you missed it.

Title: Re: IDE causes high cpu / fan usage
Post by: WacKEDmaN on Oct 17, 2018, 04:54 pm
optimizing cores.. or optimizing programs for multi threading? that sounds like two completely different things...yes i know about optimizing MY OWN programs....but i cannot optimize the IDE without trawling through the source..which im not being paid to do!!

im am aware of win10 tweaks and have alot in place...cortana, if you look is in suspended mode..and i use its search function...so its not bloatware for me..win10 is just as fast as win7 was on my system for everything i run..the win10 hate is obvious...

but alas..this is not fixing the issue at hand...

there IS an issue in the IDE that needs addressing
hopefully someone in the know can take a look and provide a fix in the next update..

Title: Re: IDE causes high cpu / fan usage
Post by: ballscrewbob on Oct 17, 2018, 05:01 pm
Quote
but alas..this is not fixing the issue at hand...
True however some of the more simple things have been pointed out, and dissed by you as BS which is clearly not the case.

I am left with "physician, heal thyself"

Title: Re: IDE causes high cpu / fan usage
Post by: WacKEDmaN on Oct 17, 2018, 05:24 pm
if it was the simple things.. id have found the issue by now.. :eyeroll:

a) its not a/v..ide still maxes core after some time with a/v off..
b) dust doesnt cause a core to max out..
c) no modem, bluetooth, no virus or malware

after rereading the entire thread i see theres actually 2 different issues here... one pegs the cpu just on running the IDE...and the other issue is that the IDE is pegging a core at random times after its been idle for hours...
Title: Re: IDE causes high cpu / fan usage
Post by: MatthewDriver on Oct 23, 2018, 01:07 am
Hi WacKEDmaN,

I am seeing the same problem as you.


40% CPU utilisation by IDE/Java, mostly after a compile, sometimes before a compile. Then the CPU never drops back down.

System: Windows 10 Pro 64bit, i7, 8Gb, 512Gb SSD, HP notebook

I develop for four different chips: ATTINY45, ATMEGA328P, ATMEGA1284P, ESP8266.

To make the board configurations simpler I have a portable IDE for each chip.

I discovered that only the IDE's on version 1.8.7 had the high CPU problem and those on 1.8.5 were fine.

If I had two IDE's running that were both 1.8.7, I would end up with 80% CPU utilisation (until I closed the IDE's).

My solution for the moment is to roll back all my environments to 1.8.5.

I have not tried 1.8.6.

I total agree there is a bug in 1.8.7.

Cheers,

Matthew.



Title: Re: IDE causes high cpu / fan usage
Post by: cb88 on Oct 23, 2018, 04:26 pm
@ballscrewbob stop telling people the problem is them. I'm a developer and there is obviously a bug in the Arduino code. I've read you dismissing people's problems like this for many months and it is very insulting.

I've attached a photo of this occuring on my PC you can download JProfiler with a trial license and get the same thing, this is the call graph that is generated by profiling the cpu hogging JVM. This occurs right after hitting compile. It appears to be a broken graphics event handler...

This has absolutely nothing to do with any other thing on the computer, the rest of the OS and all other programs are completely idle. I also have a very light install of windows 7 that runs very well. That said any suggestion that it could ever have been any of those things, when you close out Arduino and it stops is blatantly bogus. Also you apparently have no idea how anti virus software works... there is no active scanning as you type going on etc... the arduino software doesn't even do anything remotely suspicious anyway except perhaps when it checks for updates.

Such suggestions are fine perhaps the first time you hear about a problem... but as I can see with a quick forum search you've been giving these response to people dealing with this Arduino bug for many months at least since January... stop!
Title: Re: IDE causes high cpu / fan usage
Post by: ballscrewbob on Oct 23, 2018, 04:56 pm
@cb88

It is NOT the people using the IDE that is the problem that suggestion is clearly BOGUS on your part.
There are a MULTITUDE of possible causes and you as a "developer" will be extremely aware of that.

As far as AV causing issues with CPU spikes that case has been proven on multiple occasions and not just from my advice.
A forum search will bear that out.

Do you have a precise answer ?
Are you offering any forms of alternative answer apart from those offered by many besides myself  ?

I already stated on at least two occasions in the forums that there is a SPIKE WHEN YOU HIT compile.
That in most cases tails off quite quickly.

I can get that to occur on most of the IDE's including NON ARDUINO and NON JAVA based programs which you as a dev will also be aware of.

if you wish to take this further you are welcome to go PM rather than direct a personal attack.



Title: Re: IDE causes high cpu / fan usage
Post by: WacKEDmaN on Oct 23, 2018, 10:03 pm
Hi WacKEDmaN,

I am seeing the same problem as you.


40% CPU utilisation by IDE/Java, mostly after a compile, sometimes before a compile. Then the CPU never drops back down.


glad its not just me...mine does it randomly tho..it'll just start this 'race' condition out of the blue.. compile usually does spike the CPU as its doing work..

but i have found something interesting.. i go File -> Save the 'race' condition stops :) ..it still kicks in randomly tho later on tho :(

EDIT: and just after i posted this i triggered the 'race' condition!... simply minimizing the IDE window to taskbar (serial monitor window open in a window).. again, Save did the trick to stop the 'race'...(cant save when minimized tho!)

what say you now BALLSCREWBOB < profanity adjusted
Title: Re: IDE causes high cpu / fan usage
Post by: ballscrewbob on Oct 23, 2018, 10:50 pm
Apples and oranges.

Almost no two systems are the exact same be it hardware, OS, installed programs etc.
What can I tell you I see a spike at the start of a compile but that draws down quite rapid.

It is an age old thing that crops up once in a blue moon on here but some take it as the worst thing since the last ice age. ;)

Title: Re: IDE causes high cpu / fan usage
Post by: WacKEDmaN on Oct 24, 2018, 12:18 am
....theres nothing to compare ..the common theme here is the IDE..not hardware or software or whatever else you want to come up with today...just coz you are not seeing it doesnt mean its not there

we are trying to explain a problem(i specifically signed up to post about this issue), possibly find the cause, and either work around the issue or find a fix.. but you keep providing the same old same old..i suggest you just moderate the forum and keep out of this thread if you cannot provide any new info... SMH...
Title: Re: IDE causes high cpu / fan usage
Post by: MatthewDriver on Oct 24, 2018, 01:21 am
Hi WacKEDmaN,

What IDE version are you seeing this problem with and have you tested any others?

I see the fault with 1.8.7
I don't see the fault with 1.8.5

Cheers,

Matthew.


Title: Re: IDE causes high cpu / fan usage
Post by: Coding Badly on Oct 24, 2018, 02:30 am

Are there any Java developers in the pool of people having CPU usage trouble?

Title: Re: IDE causes high cpu / fan usage
Post by: WacKEDmaN on Oct 24, 2018, 07:33 am
Hi WacKEDmaN,

What IDE version are you seeing this problem with and have you tested any others?

I see the fault with 1.8.7
I don't see the fault with 1.8.5

Cheers,

Matthew.



yup 1.8.7...i might roll back.. these fans are getting annoying while im trying to code...for no good reason at all!
Title: Re: IDE causes high cpu / fan usage
Post by: ballscrewbob on Oct 24, 2018, 02:48 pm
A short video of CPU load (https://www.youtube.com/watch?v=3AqL06m8yH8&t=11s)

Security is OFF for this test.
A small amount of settle time was allowed but is not a true test.

The initial low is almost system idle.

The first PEAK is starting the screen recorder to avoid being accused of picking and choosing a screenshot.
(AVG 15% CPU load)

The second peak is startup of IDE 1.8.7.
(NOTE this will add to the cumulative JAVA and CPU load)

Third peak is COMPILE. This will peak out at all 4 cores but that will tail rapidly as can be seen in the video.

I can reproduce similar results with multiple different programs many NON JAVA.

Did confirm the observation that a SAVE from the IDE will drop the java load even further to an average of around 7%

Why a VIDEO ?  It shows how easy it is to get CPU load to peak andf in this case it also shows OPTIMISED cores as being a NON BS factor.

Hope to have a second video up shortly with security enabled to show the effects it also has and put to bed some misconceptions.



Title: Re: IDE causes high cpu / fan usage
Post by: ballscrewbob on Oct 24, 2018, 03:33 pm
CPU LOAD with security enabled  (https://youtu.be/njkjzQg2740)

Security is ON for this test. (Avast and MBAM)
A small amount of settle time was allowed but is not a true test.
IDE 1.8.7 once again used and as before a system clean up had been performed to clear out possible cache issues etc.

This time I also extended the process selection panel to get a better idea of what is peaking and not.

The initial low is almost system idle but the load added by security can clearly be seen along with the differing CORE loads !

The first PEAK is starting the screen recorder, again to avoid being accused of picking and choosing a screenshot.
(AVG 12% CPU load)
The second peak is startup of IDE 1.8.7.
(NOTE this will add to the cumulative JAVA and CPU load)
Note additionally the the screen recorder often occupies the top position above Arduino

Third peak is COMPILE. This will peak out at all 4 cores but that will tail rapidly once again.

Title: Re: IDE causes high cpu / fan usage
Post by: MatthewDriver on Oct 27, 2018, 06:30 am
I have been experimenting with this fault and have discovered a few things.

Firstly, let's define the fault I'm referring to:

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

I have tested difference IDE builds.

The following versions show this fault: 1.8.6 and 1.8.7
The following versions do not show this fault: 1.8.5, Hourly build 25 Oct and Beta 1.9.

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.

So there is hope that this fault has already been identified and will not exist in the next stable release.

For now, I'll stick with using 1.8.5.

Anyone that already his this fault is welcome to reproduce these finding and confirm it or provided an alternate view.

Cheers,

Matthew.


Title: Re: IDE causes high cpu / fan usage
Post by: WacKEDmaN on Oct 27, 2018, 03:25 pm
that sums up my issue exactly MatthewDriver..can confirm that is the behavior im seeing...

..it would be nice if we didnt have to go around in circles to get there!...

ill be going back to 1.8.5 myself until there is a new update..
Title: Re: IDE causes high cpu / fan usage
Post by: Coding Badly on Oct 27, 2018, 08:04 pm
Anyone that already his this fault is welcome to reproduce these finding and confirm it or provided an alternate view.
Confirmed exactly as described.

Is there an issue on Github for this exact problem?

Title: Re: IDE causes high cpu / fan usage
Post by: MatthewDriver on Oct 28, 2018, 11:19 pm
Hi Coding Badly,

I have check https://github.com/arduino/Arduino/issues/ back until September 2017 and can not see this specific issue mentioned.

I can't find a list of version release dates, so not sure how far back to look.

Perhaps it's only impacting a minority of users and another bug fix has already fixed this issue in the beta and hourly build.

Matthew.
Title: Re: IDE causes high cpu / fan usage
Post by: ballscrewbob on Oct 29, 2018, 02:28 pm
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 (https://create.arduino.cc/).
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.


Title: Re: IDE causes high cpu / fan usage
Post by: westfw on Oct 30, 2018, 03:42 am
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?
Title: Re: IDE causes high cpu / fan usage
Post by: ballscrewbob on Oct 30, 2018, 03:49 am
@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.
Title: Re: IDE causes high cpu / fan usage
Post by: MatthewDriver on Oct 30, 2018, 06:29 am
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.
Title: Re: IDE causes high cpu / fan usage
Post by: westfw on Oct 30, 2018, 09:17 am
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/ (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.)
Title: Re: IDE causes high cpu / fan usage
Post by: Coding Badly on Oct 30, 2018, 09:45 am

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.

Title: Re: IDE causes high cpu / fan usage
Post by: MatthewDriver on Oct 30, 2018, 10:10 am
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.

Title: Re: IDE causes high cpu / fan usage
Post by: ballscrewbob on Oct 30, 2018, 01:32 pm
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.



Title: Re: IDE causes high cpu / fan usage
Post by: Coding Badly on Oct 30, 2018, 07:40 pm
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.

Title: Re: IDE causes high cpu / fan usage
Post by: westfw on Oct 30, 2018, 09:13 pm
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.
Title: Re: IDE causes high cpu / fan usage
Post by: ballscrewbob on Oct 30, 2018, 09:29 pm
That doesn't really explain why I see a marked lowering of CPU usage with the IDE since the JAVA update.

Just more questions  :-\
Title: Re: IDE causes high cpu / fan usage
Post by: Coding Badly on Oct 31, 2018, 10:01 am

I believe this is the section of interest...
https://github.com/arduino/Arduino/blob/ee1967cd530ceb9a1d638875e385157e90d532e8/build/windows/launcher/config.xml#L57-L68 (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 (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.

Title: Re: IDE causes high cpu / fan usage
Post by: swilkens on Oct 31, 2018, 08:47 pm
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 (https://github.com/arduino/Arduino/issues/8009)
Quote
Closing as fixed by updating bundled JREs
Title: Re: IDE causes high cpu / fan usage
Post by: WacKEDmaN on Nov 03, 2018, 11:16 pm
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 :)
Title: Re: IDE causes high cpu / fan usage
Post by: shoo on Dec 06, 2018, 03:32 pm
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.
Title: Re: IDE causes high cpu / fan usage
Post by: neilw20 on Dec 28, 2018, 05:49 am
"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.
CONFIRMATION:

I renamed java folder (in "program files\arduino\") to java-old to save it. As we age, we learn how not to break things.
Copied a new java folder from 1.9.0 beta zip file.

I didn't notice fan (A/Cond makes more noise than my fan) but CPU use dropped from >50% as it should.
Now 2% when IDE window looses focus.

2% is much better when IDE window looses focus!! :)


>10 year old Toshiba L500 with Windows 7 (32 bit)
Laptop was getting sluggish switching to my schematic editor was why I chased this 'feature'

Thanks Mathew.
Neil
Title: Re: IDE causes high cpu / fan usage
Post by: Ehsani on Jan 07, 2019, 11:10 am
Replacing java folder of 1.9 beta version worked for me too. Thanks a lot.
Title: Re: IDE causes high cpu / fan usage
Post by: tigger on Jan 08, 2019, 02:44 pm
Looking forward to seeing if this problem can be fixed on my system.
Right now looking at task manager (Win 10) with CPU (Intel i5) running at about 68% usage. Of that, 33% is down to one instance of IDE Java SE binary 32-bit and about the same for another instance. One instance has a COM port open with Serial Monitor running and the other just has sketches open.
Not being as experienced as most of the other contributors, I had trouble just finding the version of Java included with the IDE program. FWW, I opened the "release" file in Notepad ++ (ever dependable) where it comes up as version 1.8.0 171.
Currently running IDE 1.8.7 which needs an update to 1.8.8 or I might try changing the Java folder as suggested.
Thanks for all the efforts
Title: Re: IDE causes high cpu / fan usage
Post by: tigger on Jan 17, 2019, 02:28 pm
Pleased to report that the update from 1.8.7 to 1.8.8 has so far completely eliminated this problem.
The IDE and Java were consuming more CPU resources than all the applications put together and I am certain that it caused several eventual crashes or freezes of the PC as a whole.
For reasons nothing to do with Arduino, I had to leave two instances of the IDE running for well over a week with one churning out serial monitor data as well. The Java CPU usage on both instances was in the region of 1% (unchanged) and overall CPU usage running at 8%. Previously, this would have been knocking on 70-80% usage, most of it down to Java.
Glad to see the back of it and a return to "normal" running.
Thanks to whoever fixed it
Title: Re: IDE causes high cpu / fan usage
Post by: Knelf on Jan 21, 2019, 10:55 pm
Thanks for the detective work, just spotted a maxing core tonight. Kicks in after about 2 mins of running the arduino IDE with it sitting idle. Again its the javaw process. Will try the update later and see if it fixes things

Title: Re: IDE causes high cpu / fan usage
Post by: tigger on Jan 22, 2019, 01:34 pm
Spoke too soon.
After days of good running, CPU back up to 30% on one IDE instance.
Title: Re: IDE causes high cpu / fan usage
Post by: anttok on Aug 02, 2019, 03:19 am
+1 on high pcu/fan usage when either serial monitor or plotter are open. My cpu almost smoking and its a brand new 8700. Close it, and everything gets real quiet immediately.