Description
Describe the problem
Arduino Language Server and clangd create some temporary files:
Name format:arduino-language-server2131811926/
Arduino CLI sketch build folder(Solved by Do proper clean-up of tmp directories #146)
- Name format:
system-includes-0f3fe3.clangd
- Created by clangd
- Name format:
preamble-4df37f.pch
- Created by clangd
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
- Take note of the contents of your temporary folder.
- Windows:
C:\Users\<user name>\AppData\Local\Temp
- Linux:
/tmp
- macOS
$TMPDIR
- Windows:
- Start Arduino IDE 2.x.
- 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. - Wait for the "Building sketch" and/or "indexing ..." operations indicated on the left side of the Arduino IDE status bar to finish.
- Select File > Quit from the Arduino IDE menus.
- 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
Operating system
- Windows
- Linux
- macOS
Operating system version
- Windows 11
- Ubuntu 22.04
- macOS Ventura
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:
- https://forum.arduino.cc/t/cleanup-of-tmp-seems-inop-kubuntu-20-04/1072075
- https://forum.arduino.cc/t/windows-10-ide-2-0-2-slow-start/1061136/4
- https://forum.arduino.cc/t/rc9-2-temporary-directories/1022812
- https://forum.arduino.cc/t/temporary-files-from-the-arduino-ide/1067309
Related:
Issue checklist
- I searched for previous reports in the issue tracker
- I verified the problem still occurs when using the latest version
- My report contains all necessary details