Why is Craft storing so much temporary files inside the server tmp folder? For several websites (Craft CMS 2 &amp; 3), servers ran out ot storage even if these websites were not storing a lot of assets.

After looking for why, I ended up in the temporary (tmp/) folder of these servers (which is at a lower level of these vhosts), where I found there were a lot of Craft-related filed that were not purged.

These are, for example:


Imagick files (some of them have a size of ~500 Mb!)
A lot of Twig PHP folders and files (which content looks very similar as found in /storage/runtime/)


Questions:


When and why these files are generated?
Why they are not automatilcally deleted?
When is it safe to delete them?


To be more specific:


Because I'm using Imgix, front-end image transforms are delegated to this remote service;
In this case, I think that only the CP uses Imagick;
Imagick uses the /tmp folder by default, but you can change it: https://github.com/ImageMagick/ImageMagick/issues/399#issuecomment-285793433