If ImageMagick doesn't have enough RAM memory then it uses a temporary file for operations instead, however if an operation fails for whatever reason then these files get left behind, and some of them can be quite big, and will cause the temp folder to fill up (potentially resulting in issues with any limits set).
I'm just wondering what mechanism ImageMagick uses for creating temporary files, as I believe most operating systems should provide a means of creating temporary files that are guaranteed to be discarded when the program terminates for whatever reason.
Leftover Temp Files
Re: Leftover Temp Files
ImageMagick destroys any temporary files unless its interrupted by an uncatchable signal such as KILL. Its possible the version you're using has a bug. If you're using the latest version, 6.8.9, post a command line that leaves temporary files behind and we will investigate further.