My PC did spend a significant amount of time removing .arduinoIDE-unsaved* directories from c:\users\sterretje\appdata\local\temp. There were over 230,000 directories since 2022/08/01 and not all of them were empty (but that might be a forced reboot by Windows or a crash).
I'm currently not sure if the issue is mostly from RC9 and before or if it still exists in RC9.1/RC9.2.
Hi @sterretje. Are you sure they all had the pattern .arduinoIDE-unsaved*? The reason I ask is because I just did a check and I have 193 of these from the last week, which seems like an approximate match for the number of sketches I worked with during that time.
However, for the same week I have 1845 arduino-language-server* folders, which are using 253 MB.
What happens if you try this?:
If the Arduino IDE is running, select File > Quit to exit all windows.
Clear the c:\users\sterretje\AppData\Local\Temp folder
Start the Arduino IDE.
Select a board if one is not currently selected.
Select File > New from the Arduino IDE menus.
Select a board if one is not currently selected.
Wait for sketch processing to finish, as indicated on the left side of the IDE status bar.
Select File > Quit from the Arduino IDE menus.
I got one .arduinoIDE-unsaved* and four arduino-language-server* folders from this procedure, which doesn't seem too unreasonable.
I tried it again with a single window that opened a new sketch on startup. I made several changes to the sketch, triggering multiple language server processing operations. I did multiple compilations. This created one .arduinoIDE-unsaved* and two arduino-language-server* folders, which matches to my first experiment.
I tried that second experiment again with the "Auto Save" preference disabled (I had it enabled in the first two experiments) and got the same results.
The results of those experiments seem somewhat reasonable. I'm not really sure what the standards are for clean up by applications (i.e., is this supposed to be the application's responsibility, or the operating system?).
In the case of the compilation cache, it is actually quite handy that it persists between Arduino IDE 2.x sessions. Arduino IDE 1.x cleans it up on exit, which means the first compilation for each board during each session of Arduino IDE 1.x is slow, while I notice the compilations in Arduino IDE 2.x seem significantly faster because you only need to compile the core once for each board, and then again after a Boards Manager update or manual modification. Of course, that might also be annoying in the rare case where the cache is corrupted, which used to be fixable simply by restarting the IDE. I don't think all these language server temporary folders are of any use after creation. The unsaved sketch folders might be useful for recovery of a sketch after an IDE or system crash, power outage, or user error, but otherwise are not needed.
I did not exactly do that but starting the IDE indeed creates one .arduinoIDE-unsaved* directory. I did paste a sketch and compiled. Closing the IDE leaves that directory in the temp directory and a stack of other arduino related directories.
The 55.... directories contain the IDE's json files.
Note
I spend most of my Arduino time helping people here on the forum; this results incopying from threads and pasting in the IDE
sometimes over an existing one
sometimes using file-> new and pasting in there.
I hardly ever save those skeches; once-off to help and that's it.
That might be the difference between how you use the IDE and how I use it.
I will keep an eye on it and see how it develops over time.