Too Many Temporary FIles Makes Error (informational)

I got the following error that started popping up:

internal error in mingw32_gt_pch_use_address, at config/i386/host-mingw32.c:190: MapViewOfFileEx: Attempt to access invalid address. 


exit status 1

Compilation error: exit status 1

I got it to go away by deleting the temporary files in my user appdata folder.
I have done a lot of compilations since I last deleted it. It would appear at some point the shear volume causes things to break.
But all good now.

  • Wes

Some improvements were made in the Arduino IDE 2.0.4 release related to cleaning up temporary files:

There is still some more work to do in that area, but I think you will find a significant reduction in the accumulation going forward. The remaining work is tracked here:

I remembered the "Temporary Files are not cleaned up" post, but couldn't locate it to cite it.
I have been using 2.0.4 since it was released, so even the improvements that were made can be negated if pounded on long enough (I had somewhere above 1GB of temp files, almost all IDE related). I was on a roll and wrote a lot of code, with lots of compile/verify iterations.

  • Wes

Did you clean up the temporary folder after updating to 2.0.4? The bulk of the accumulation there might have been from previous Arduino IDE versions.

I think the temporary files come from a previous version, try to clean it up and check if it's still happening.

Well, I deleted Temp yesterday, I am only running 2.0.4 (exclusively), and now there are 200 MB of files in Temp. From one day's work.
Some are other things, but the majority are IDE related items.

Now that I know it can create problems long before the disk itself gets full, I can empty it.
That might be a good practice to follow.

  • Wes

I realize I was not as specific as I should have been about the Temp files location in my first post.
There is a Tmp directory in the Appdata/Local/Arduino15 folder in my user data, that is empty.
It is the Temp directory in the Appdata/Local folder that keeps growing.
I cleared it all, did one compilation with 2.0.4 and what did I find?


Screenshot 2023-03-24 114153

That is why my problem running the IDE happened... eventually this grows from 36 MB to hundreds.

  • Wes

I suggested on github that all temporary fikes should be stored in a dedicated directory; it's now partially implemented. This does not solve the issue of it growing but at least there will be a single directory that can be deleted when needed.

There can be various reasons why it's not cleaned up. The IDE (in the broadest sense) is sloppy is the main reason in my opinion, OS and antivirus might also prevent temporary files from being deleted.

Thanks for the information... I just can't seem to keep up with GitHub.
I can be patient on this... it takes quite a few of compilations to get to the "makes an error happen" stage. And now I know to check Temp regularly.

Still, one more PITA thing to do.

  • Wes

The creation of the folders like 55770067919477794103602099745 has already been fixed:

However, there hasn't been a new release of the "Arduino Firmware Uploader" tool since that time so the fix hasn't propagated into Arduino IDE yet.


The arduino folder is the dedicated folder for temporary files produced by Arduino development tools, as proposed by sterretje:

Compilation caches are intentionally preserved in that folder so that they can be reused during subsequent IDE sessions. So it is intended that there will be some files left over in that folder. However, there is now a periodical cleanup of caches that were not recently used to limit the accumulation:

You can configure that cache purging behavior by editing the configuration file at this location:

C:\Users\<username>\.arduinoIDE\arduino-cli.yaml

(where <username> is your Windows username)

The configuration options are documented here:

https://arduino.github.io/arduino-cli/latest/configuration/#configuration-keys

  • build_cache configuration options related to the compilation cache
    • compilations_before_purge - interval, in number of compilations, at which the cache is purged, defaults to 10.
      When 0 the cache is never purged.
    • ttl - cache expiration time of build folders. If the cache is hit by a compilation the corresponding build files lifetime is renewed.
      The value format must be a valid input for
      time.ParseDuration(), defaults to 720h (30 days).

The leftover arduino-ide2-88a..., github-remote/, http-remote/, theia_upload/ folders and gdb-server-console-8508.log file are tracked here:


The leftover .pch and .clangd files are tracked here:

There is a fix for those in progress now:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.