arduino / arduino-language-server

An Arduino Language Server based on Clangd to Arduino code autocompletion
GNU Affero General Public License v3.0
133 stars 11 forks source link

Temporary files are not cleaned up #145

Closed per1234 closed 1 year ago

per1234 commented 1 year ago

Describe the problem

Arduino Language Server and clangd create some temporary files:

The first two of these persist even after the user exits the IDE.

The files accumulate over time, consuming significant amounts of disk space and may eventually cause a performance impact.

To reproduce

  1. Take note of the contents of your temporary folder.
    • Windows:
      C:\Users\<user name>\AppData\Local\Temp
    • Linux:
      /tmp
    • macOS
      $TMPDIR
  2. Start Arduino IDE 2.x.
  3. Select Tools > Board > Arduino AVR Boards > Arduino Uno from the Arduino IDE menus. This is only an arbitrary choice of a board that is supported by the language server.
  4. Wait for the "Building sketch" and/or "indexing ..." operations indicated on the left side of the Arduino IDE status bar to finish.
  5. Select File > Quit from the Arduino IDE menus.
  6. Examine the contents of your temporary folder.

🐛 Multiple additional arduino-language-servernnnnnnnnn folders are present. 🐛 (If using Windows) Multiple additional system-includes-nnnnn.clangd files are present. 🐛 The files produced by this single minimal demo consume a significant amount of disk space (on the order of > 0.5 MB on Windows).

Expected behavior

Temporary files are cleaned up on exit.

Arduino Language Server version

bdef5c27830b1d4a33908068ed87514757874052

Operating system

Operating system version

Additional context

I don't see the system-includes-nnnnn.clangd files in the temporary folder on Linux and macOS even while the IDE is running, so I am not sure whether they are never created at all, or whether they are stored in some other location.


Additional reports:


Related:

Issue checklist

cmaglie commented 1 year ago

Reopening to investigate clangd-related temp files.

umbynos commented 1 year ago

@per1234 could you please test if this can be reproduced with #154 we are not able to reproduce this