Temporary Files are used by computer programs to store data temporarily while the program is in execution. They are used as a backup in case the program halts. Usually, a program deletes the temporary files after it has completed its tasks. Some programs also create temporary files when there isn't enough memory available for allocating to task, when the data is bigger than the architecture's address space, or even as a form of communication between multiple processes.
Popular Temporary File Extensions
TMP — Temporary files use the “.TMP” file extension and are usually created by programs as a form of backup or cache. Usually, programs delete temporary files automatically when they are closed. They provide a way to recover lost data in case the program is halted in mid-execution. However, if the program doesn't delete the file, they can clog up your system's memory as more files are being created.