High CPU and memory consumption

When writing the program,I found that Arduino ide occupies a high CPU and consumes a large amount of memory in the process of writing the program text. The project is relatively simple, with only three files and hundreds of lines of code.

1 Like

Well I'd be happy that the app I'm using is getting that much, 29.3%, attention from the CPU.
What is the other 70.7% doing? (Nothing??)

Tom... :grinning: :+1: :coffee: :australia:

Just use a faster CPU with more cores and that number will go down giving you more processor power to do nothing. Just a SWAG, by using more resources it responds faster saving you time.

The number does not go down with faster computer!
I have a fast machine and CPU utilisation reaches 100% and clock speed increases to 130% and the ventilators blow like hell.
Restarting the ide solves the issue for a while (until the next compile and load)

I have no idea what changed in Arduino software, but the indexing and build problem seems to have disappeared today.
Sudenly I get a lot more functionality out of the IDE, I get code help while typing...

I'm glad to hear this @Xinonix. Was the changed behavior associated with you updating to a new version of the IDE (e.g., a new nightly build)?

No, I did not do any updates on the installed SW. It just happened.
Today same sketch and CPU usage is high again....

:cry: That is unfortunate. I am always most happy when I can identify the cause and solution for a problem, but I will settle for a bug mysteriously fixing itself. I guess they don't always like to stay self-fixed though.

I assume your computer is connected to the internet.
How do you know that windoze isn't doing an update, or any of your apps isn't doing likewise?

Disconnect your computer from the internet, I know its a horrible thought, and let it sit for 5 minutes to get over the shock, then try playing Arduino, with the internet still disconnected.

What virus checker do you have?

Tom.... :grinning: :+1: :australia: :coffee:

I have the following information:




Disk activity

All while Arduino is suposed to be idle, I have not touched the IDE for the last hour, it is "just " running in the background while I was having dinner. You can see that my CPU goes to 132% max frequency!

I use AVIRA antivirus.

There is no update process running and no specific high activity from the antivirus sw.

Disconnected from the network, the CPU utilisation goes down after a few minutes to very low. But then code suggest does not work anymore?

Arduino IDE 2.x uses Arduino CLI for all the non-GUI operations. That includes processing the sketch code for the language server features such as code suggestions.

Communication between Arduino IDE and Arduino CLI is done through a TCP port, with Arduino CLI running in daemon mode. So it is necessary to enable network communication between the two applications. It is not certain that the network communication itself is the cause of the high CPU usage. Rather, it might be that disabling the network communication prevents whatever process causes the high CPU process, and thus the CPU utilization drop is only a side effect of disabling the network communication.

1 Like

What version of the IDE are you using?

Tom... :grinning: :+1: :australia: :coffee:

Running 2.0 rc3

What if you ran the 1.8.19 IDE that run on your PC, that way when you disconnect the internet, the IDE keeps running.

The 2.0rc3 etc hasn't convinced me that it is a better concept being online.
I prefer to have my IDE in my computer where I can control it, independent of the internet.
Now if they made a PC based version of the Beta2, I would look at it a bit longer.

Tom... :grinning: :+1: :coffee: :australia:

I apologize if my previous statement was misleading. The Arduino IDE 2.x keeps running just fine without an Internet connection. The TCP port communication between Arduino IDE 2.x and Arduino CLI is internal to your computer, between two applications running locally on your computer. If you disable that internal communication, it does indeed stop working because Arduino CLI is really the engine under the hood of the IDE.

There is a requirement for the Arduino IDE 2.x to have Internet access on a fresh installation because the IDE installation is only for the IDE itself. Unlike Arduino IDE 1.x, it does not come with a bundled copy of the "Arduino AVR Boards" platform and the fundamental libraries such as Ethernet, Keyboard, Mouse, SD, etc. Instead, the latest version of those is installed automatically via the Library Manager and Boards Manager infrastructure on the first run after a fresh installation.

There are some additional optional capabilities which do require access to the Internet to download resources:

As for the first three, the situation is exactly the same with Arduino IDE 1.x.

As for the fourth, the approach used by Arduino IDE 1.x of only providing the firmware versions that were available at the time of the IDE release is really not workable. The owners of those boards need an easy way to update to the latest version of the firmware. With the Arduino IDE 1.x approach, there is no easy way to do that. So IMO the new system is a huge improvement.

As for the last, this is completely optional, and can even be removed from the interface completely if you have no interest in it.

I guess you have some more careful looking to do. Please let us know if you have any feedback.

I also experienced this issue using RC3. My laptop is Win10, I7 CPU, 12m. After an hour of work, the memory was 85%, CPU was 100%, and eventually, I got a message about 'out of page space'. I had to restart to clear everything. I monitored the memory usage and it steadily increased over time. I think this is a real issue.

1 Like

Is there a way to monitor local behaviour? e.i. debug mode for the IDE? I think it might provide usefull information for why it is using all local resources.

If you select Help > Toggle Developer Tools from the Arduino IDE menus, it will open the Chrome DevTools.

The truth is that I don't know much about using these tools. The obviously useful component is the "Console" tab, but I tend to run the Arduino IDE from the command line for this type of information, and get a bit more of it there.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.