Indexing performance issues

The CPU (i5-6200U) on the laptop I'm using is not the most powerful, but something seems to be wrong with the performance in the RC1 & RC2 and nightly 20211219.

  1. When I load up a sketch the CPU is 0% and RAM about 400MB for the IDE process. Indexing completes in less than 2s.
  2. After about half an hour of editing and uploading - CPU 47%, and RAM jumping between 1100-500MB, indexing and building sketch takes longer and longer.
  3. After about an hour or more the CPU is fluctuating between 57-49% and RAM 2300-1200MB, indexing and building sketch never finishes. Scrolling the editor is really laggy now also.
  4. Saving and restarting the IDE brings the CPU down to 2% and RAM to 500MB.

Could be that this gets unnoticed by more powerful CPUs. Haven't tried with my desktop.

This problem could be related to this issue:

It seems similar to this other report:

As I mentioned there, I have not experienced this myself, but I tend to restart the IDE frequently because I am always switching from one test build to another. So, even though I give it a lot of use, I might not notice a long term cumulative issue.

You are welcome to submit a formal bug report to the Arduino IDE 2.x issue tracker to allow the developers to more effectively track this issue:
https://github.com/arduino/arduino-ide/issues/new?labels=type%3A+imperfection&template=bug_report.md

Aah true, I've read that thread a week ago but my IDE has never crashed.

Okay I'll do that later this week.

EDIT:

1 Like

I have a fast machine with lots of RAM, and face the same issue: Indexing never "finishes" or is replaced by "building". And since indexing never seems to stop the "auto format" also only works at start up and never again afterwards (until restart) . I do have a slow network connection and wonder if that might influence things.

I see the same problem. After a short while editing the CPU usage graph is like a mountain range, fans going fast, while "Indexing" or "building" runs continuously. Leaving it alone for a few mins does not solve it, only restarting the IDE.

Feels strongly like some process looping to me.

Running 2.0.0-rc3 in Kubuntu 20.04. Intel i3-8190U cpu 3Ghz, 8GB ram.

Yesterday I noticed that the indexing/building stopped working completely after an hour or two. Then the IDE got really smooth to work with again. It's process went down to <500MB ram usage and <5% CPU.
Too bad the error and variable locations in the scrollbar also stopped working. But that was to be expected since the indexing is probably needed for those stuff to work.

I think I am having a similar problem. The indexing never seems to stop, even when nothing is being done. It says 0/1 with the spinning arrows turning. Is this a bag of a feature?
image

Hi @nitzanbre.

There was a bug in the progress reporting system that caused the IDE to indicate the "indexing" state even after indexing had finished. The developer of the Arduino Language Server tool used by the Arduino IDE code aware features found a fix for it:

That fix should be in the next release of the Arduino IDE.

My understanding was this was purely cosmetic in that it was only a false progress indicator. For that reason, I don't think it was the cause of the CPU usage issues reported earlier in this thread,

Thank you for sharing this information

I noticed that Indexing restart everytime when I even make the slightest of changes.
This is the Powershell output from the change to 1 loc.

daemon INFO inventory.Store.ConfigFileUsed() c:\Users\Johan\AppData\Local\Arduino15\inventory.yaml
daemon INFO inventory.Store.ConfigFileUsed() c:\Users\Johan\AppData\Local\Arduino15\inventory.yaml
daemon INFO Searching tools required for board esp32:esp32:esp32
daemon INFO Required tool [tool: {ToolName:"esptool_py",ToolVersion:"3.1.0",ToolPackager:"esp32"}]
daemon INFO Required tool [tool: {ToolName:"mklittlefs",ToolVersion:"3.0.0-gnu12-dc7f933",ToolPackager:"esp32"}]
daemon INFO Required tool [tool: {ToolName:"mkspiffs",ToolVersion:"0.2.3",ToolPackager:"esp32"}]
daemon INFO Required tool [tool: {ToolName:"riscv32-esp-elf-gcc",ToolVersion:"gcc8_4_0-esp-2021r2",ToolPackager:"esp32"}]
daemon INFO Required tool [tool: {ToolName:"xtensa-esp32-elf-gcc",ToolVersion:"gcc8_4_0-esp-2021r2",ToolPackager:"esp32"}]
daemon INFO Required tool [tool: {ToolName:"xtensa-esp32s2-elf-gcc",ToolVersion:"gcc8_4_0-esp-2021r2",ToolPackager:"esp32"}]
daemon INFO Adding libraries dir [dir: C:\Program Files (x86)\Arduino\libraries, location: ide]
daemon INFO Adding libraries dir [dir: C:\Users\Johan\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.2\libraries, location: platform]
daemon INFO Adding libraries dir [dir: c:\Users\Johan\Documents\Arduino\libraries, location: user]
daemon INFO Resolving include FS.h for arch esp32
daemon INFO found better lib [lib: FS, prio: 64C]
daemon INFO Resolving include SPIFFS.h for arch esp32
daemon INFO found better lib [lib: SPIFFS, prio: 64C]
daemon INFO Resolving include bsec.h for arch esp32
daemon INFO found better lib [lib: BSEC_Software_Library, prio: 521]
daemon INFO Resolving include Wire.h for arch esp32
daemon INFO found better lib [lib: Wire, prio: 64C]
daemon INFO Resolving include SPI.h for arch esp32
daemon INFO found better lib [lib: SPI, prio: 64C]
root ERROR Error: Aborted onWillSaveTextDocument-event after 1750ms
at file:///C:/Users/Johan/AppData/Local/Programs/arduino-ide/resources/app/lib/vendors-node_modules_theia_callhierarchy_lib_browser_index_js-node_modules_theia_plugin-ext_l-25966f.bundle.js:1811:41
root ERROR Error: Aborted onWillSaveTextDocument-event after 1750ms
at file:///C:/Users/Johan/AppData/Local/Programs/arduino-ide/resources/app/lib/vendors-node_modules_theia_callhierarchy_lib_browser_index_js-node_modules_theia_plugin-ext_l-25966f.bundle.js:1811:41
root ERROR Error: Aborted onWillSaveTextDocument-event after 1750ms
at file:///C:/Users/Johan/AppData/Local/Programs/arduino-ide/resources/app/lib/vendors-node_modules_theia_callhierarchy_lib_browser_index_js-node_modules_theia_plugin-ext_l-25966f.bundle.js:1811:41
root ERROR Error: Aborted onWillSaveTextDocument-event after 1750ms
at file:///C:/Users/Johan/AppData/Local/Programs/arduino-ide/resources/app/lib/vendors-node_modules_theia_callhierarchy_lib_browser_index_js-node_modules_theia_plugin-ext_l-25966f.bundle.js:1811:41
daemon INFO inventory.Store.ConfigFileUsed() c:\Users\Johan\AppData\Local\Arduino15\inventory.yaml
daemon INFO inventory.Store.ConfigFileUsed() c:\Users\Johan\AppData\Local\Arduino15\inventory.yaml
daemon INFO Searching tools required for board esp32:esp32:esp32
daemon INFO Required tool [tool: {ToolName:"esptool_py",ToolVersion:"3.1.0",ToolPackager:"esp32"}]
daemon INFO Required tool [tool: {ToolName:"mklittlefs",ToolVersion:"3.0.0-gnu12-dc7f933",ToolPackager:"esp32"}]
daemon INFO Required tool [tool: {ToolName:"mkspiffs",ToolVersion:"0.2.3",ToolPackager:"esp32"}]
daemon INFO Required tool [tool: {ToolName:"riscv32-esp-elf-gcc",ToolVersion:"gcc8_4_0-esp-2021r2",ToolPackager:"esp32"}]
daemon INFO Required tool [tool: {ToolName:"xtensa-esp32-elf-gcc",ToolVersion:"gcc8_4_0-esp-2021r2",ToolPackager:"esp32"}]
daemon INFO Required tool [tool: {ToolName:"xtensa-esp32s2-elf-gcc",ToolVersion:"gcc8_4_0-esp-2021r2",ToolPackager:"esp32"}]
daemon INFO Adding libraries dir [dir: C:\Program Files (x86)\Arduino\libraries, location: ide]
daemon INFO Adding libraries dir [dir: C:\Users\Johan\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.2\libraries, location: platform]
daemon INFO Adding libraries dir [dir: c:\Users\Johan\Documents\Arduino\libraries, location: user]
root ERROR Error: Aborted onWillSaveTextDocument-event after 1750ms
at file:///C:/Users/Johan/AppData/Local/Programs/arduino-ide/resources/app/lib/vendors-node_modules_theia_callhierarchy_lib_browser_index_js-node_modules_theia_plugin-ext_l-25966f.bundle.js:1811:41
root ERROR Error: Aborted onWillSaveTextDocument-event after 1750ms
at file:///C:/Users/Johan/AppData/Local/Programs/arduino-ide/resources/app/lib/vendors-node_modules_theia_callhierarchy_lib_browser_index_js-node_modules_theia_plugin-ext_l-25966f.bundle.js:1811:41
daemon INFO Resolving include FS.h for arch esp32
daemon INFO found better lib [lib: FS, prio: 64C]
daemon INFO Resolving include SPIFFS.h for arch esp32
daemon INFO found better lib [lib: SPIFFS, prio: 64C]
daemon INFO Resolving include bsec.h for arch esp32
daemon INFO found better lib [lib: BSEC_Software_Library, prio: 521]
daemon INFO Resolving include Wire.h for arch esp32
daemon INFO found better lib [lib: Wire, prio: 64C]
daemon INFO Resolving include SPI.h for arch esp32
daemon INFO found better lib [lib: SPI, prio: 64C]
daemon INFO inventory.Store.ConfigFileUsed() c:\Users\Johan\AppData\Local\Arduino15\inventory.yaml
daemon INFO inventory.Store.ConfigFileUsed() c:\Users\Johan\AppData\Local\Arduino15\inventory.yaml
daemon INFO Searching tools required for board esp32:esp32:esp32
daemon INFO Required tool [tool: {ToolName:"esptool_py",ToolVersion:"3.1.0",ToolPackager:"esp32"}]
daemon INFO Required tool [tool: {ToolName:"mklittlefs",ToolVersion:"3.0.0-gnu12-dc7f933",ToolPackager:"esp32"}]
daemon INFO Required tool [tool: {ToolName:"mkspiffs",ToolVersion:"0.2.3",ToolPackager:"esp32"}]
daemon INFO Required tool [tool: {ToolName:"riscv32-esp-elf-gcc",ToolVersion:"gcc8_4_0-esp-2021r2",ToolPackager:"esp32"}]
daemon INFO Required tool [tool: {ToolName:"xtensa-esp32-elf-gcc",ToolVersion:"gcc8_4_0-esp-2021r2",ToolPackager:"esp32"}]
daemon INFO Required tool [tool: {ToolName:"xtensa-esp32s2-elf-gcc",ToolVersion:"gcc8_4_0-esp-2021r2",ToolPackager:"esp32"}]
daemon INFO Adding libraries dir [dir: C:\Program Files (x86)\Arduino\libraries, location: ide]
daemon INFO Adding libraries dir [dir: C:\Users\Johan\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.2\libraries, location: platform]
daemon INFO Adding libraries dir [dir: c:\Users\Johan\Documents\Arduino\libraries, location: user]
daemon INFO Resolving include FS.h for arch esp32
daemon INFO found better lib [lib: FS, prio: 64C]
daemon INFO Resolving include SPIFFS.h for arch esp32
daemon INFO found better lib [lib: SPIFFS, prio: 64C]
daemon INFO Resolving include bsec.h for arch esp32
daemon INFO found better lib [lib: BSEC_Software_Library, prio: 521]
daemon INFO Resolving include Wire.h for arch esp32
daemon INFO found better lib [lib: Wire, prio: 64C]
daemon INFO Resolving include SPI.h for arch esp32
daemon INFO found better lib [lib: SPI, prio: 64C]
daemon INFO from discovery builtin:mdns-discovery received message type: add, port: 192.168.1.50
root INFO Attached boards and available ports changed:
root INFO - New port is available on 192.168.1.50 3.24.0.126-DESKTOP-21V2JA0.4909064c-e62b-4120-aedd-60c54a692f12._nvstream_dbd._tcp.local. at 192.168.1.50
root INFO ------------------------------------------

This is the normal and expected behavior.

The "building sketch" and "indexing" messages you see on the left side of the IDE status bar are indicating the action of the Arduino Language Server, which provides the new code-aware features such as parameter hints, problem detection, hover, goto, etc. in the Arduino IDE 2.x.

The language server must understand your code, including all the libraries and toolchain it uses. So this means that every time the code changes, it must be built and indexed all over again.

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