Skip to content

Temporary files are not cleaned up #145

Closed
@per1234

Description

@per1234

Describe the problem

Arduino Language Server and clangd create some temporary files:

  • Name format: arduino-language-server2131811926/
  • 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

  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

bdef5c2

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:


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

Metadata

Metadata

Assignees

Labels

criticality: highOf high impacttopic: codeRelated to content of the project itselftype: imperfectionPerceived defect in any part of project

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions