The below is a previously posted batch file to clear out the orphaned arduino temporary files. I think that having a lot of the orphaned files can under some circumstances cause the IDE to try to use a lot of memory. Below is the location on my pc of the arduino temp files. Put the batch file in the Temp folder and make a short cut to the batch file for routine cleaning.
C:\Documents and Settings\zoomkat\Local Settings\Temp
I discovered this business a week or so ago. Turns out, on my old WinXP machine that has Arduino IDE
crash problems, there were 14-GBytes of Temp files, going back for 5-6 years, and that used up fully
35% of my 40GB HD space. [35% !!!! - thank you BillGates for never doing garbage collection].
Everytime I did a compilation using one of a dozen or so development tools, a new folder was created
in Temp, and never removed.
The Arduino IDE does appear to "try to" clean out the current Temp folder when the IDE closes, although
it does not seem to remove any prior folders, so they multiply without limit over time.
Also, what I did find is that, for some reason on the machine where Arduino IDE crashes, the IDE does not
delete file "core.a" when it closes. The file attributes are set to read-only or whatever, and the file cannot even be deleted MANUALLY. When attempting to do so, you get an error msg that says something like
"file in use by another program".
Also, when I try to shut down the machine, it hangs up for minutes, then finally an error popup
occurs that says the Arduino IDE is shutting down, even though I had closed it long before.
IOW, there seems to be a couple of problems with the IDE shutting down, at least on my machine.
None of my other dozen or so dev tools has this probem, so I don't agree that the problem is "a lot
of orphaned files", rather the IDE doesn't remove them all properly.