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
    I verified the problem still occurs when using the latest version
    My report contains all necessary details

Activity

added
topic: codeRelated to content of the project itself
type: imperfectionPerceived defect in any part of project
on Jan 2, 2023
self-assigned this
on Jan 2, 2023
cmaglie

cmaglie commented on Jan 3, 2023

@cmaglie
Member

Reopening to investigate clangd-related temp files.

reopened this on Jan 3, 2023
added a commit that references this issue on Mar 21, 2023
d1cf84e
umbynos

umbynos commented on May 15, 2023

@umbynos
Contributor

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

added a commit that references this issue on Aug 17, 2023
ffb735c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

    Temporary files are not cleaned up · Issue #145 · arduino/arduino-language-server