Skip to content

Temporary files are not cleaned up #145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
3 tasks done
per1234 opened this issue Jan 2, 2023 · 2 comments · Fixed by #146 or #154
Closed
3 tasks done

Temporary files are not cleaned up #145

per1234 opened this issue Jan 2, 2023 · 2 comments · Fixed by #146 or #154
Assignees
Labels
criticality: high Of high impact topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@per1234
Copy link
Contributor

per1234 commented Jan 2, 2023

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
@per1234 per1234 added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Jan 2, 2023
@cmaglie cmaglie added the criticality: high Of high impact label Jan 2, 2023
@cmaglie cmaglie self-assigned this Jan 2, 2023
@cmaglie
Copy link
Member

cmaglie commented Jan 3, 2023

Reopening to investigate clangd-related temp files.

@umbynos
Copy link
Contributor

umbynos commented May 15, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
criticality: high Of high impact topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
3 participants