Skip to content

Disconnecting USB causes IDE to use 100% CPU on Linux #2333

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nickgammon opened this issue Sep 27, 2014 · 5 comments
Closed

Disconnecting USB causes IDE to use 100% CPU on Linux #2333

nickgammon opened this issue Sep 27, 2014 · 5 comments
Labels
Component: IDE The Arduino IDE OS: Linux Specific to the Linux version of the Arduino IDE Type: Bug

Comments

@nickgammon
Copy link

On the Ubuntu version of the Arduino IDE 1.0.5, disconnecting (unplugging) the USB cable from the PC to the Arduino Uno causes CPU usage for the Java IDE runtime to jump to 100%. What is it doing?

Code:

top - 09:43:14 up 1 day, 23:54,  4 users,  load average: 0.71, 0.60, 0.60
Tasks: 246 total,   1 running, 244 sleeping,   0 stopped,   1 zombie
%Cpu(s):  8.8 us,  5.7 sy,  0.0 ni, 85.5 id,  0.1 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem:  16376056 total, 16104688 used,   271368 free,   641840 buffers
KiB Swap: 31249404 total,        0 used, 31249404 free.  9019168 cached Mem

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND     
 2142 nick      20   0 6874812 163476  25408 S 100.1  1.0   0:27.44 java        
                                               ^^^^^

Steps to reproduce:

  • Compile and upload Blink sketch
  • Open Serial monitor
  • Run the "top" command in a console window
  • Unplug the USB cable from the Arduino
  • Note that the java process CPU climbs from around 7% to 100%
@bperrybap
Copy link

This has been true on every version of the IDE I have used for the past 5 years.
I can tell when it happens since I hear the fans on my processor ramp up from the continuous load.

@ffissore ffissore self-assigned this Jul 1, 2015
@christakahashi
Copy link

Happens in windows arduino 1.6.12 too. :(

@bperrybap
Copy link

This doesn't happen for me any more. Not sure what release fixed it, but the issue seems to have been fixed for me on linux mint a few releases ago.
Maybe it was fixed when the IDE started re-connecting to the serial port after uploading?

@per1234 per1234 added Component: IDE The Arduino IDE OS: Linux Specific to the Linux version of the Arduino IDE labels Jul 3, 2017
@grable0
Copy link

grable0 commented Mar 25, 2018

This happens for me using 1.8.5 on Windows 10, i figured out that its the Serial Monitor.
When its open and the cable is disconnected (the board doesnt even have to open the port) cpu usage jumps to around 15%, connect the board and it goes down again.
Probably stuck with some polling it does on the com port which no longer exists after the cable is unplugged...

@facchinm
Copy link
Member

Should be solved by #8046, please reopen if the issue still occurs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: IDE The Arduino IDE OS: Linux Specific to the Linux version of the Arduino IDE Type: Bug
Projects
None yet
Development

No branches or pull requests

7 participants