Having variable(s) go out of scope should free them but for the next use is whether or not there is a big enough continuous space to allocate for the next new need.
I'm new to this but it appears that println() assembles the string to be printed in RAM. Does that de-allocate when the string is printed? Oh no, it's worse than I thought:
(Note: string literals take up room in the Flash (program) memory AND the RAM. When the program starts, the strings are copied from Flash to RAM.)
To say the least, there is room for improvement. Hmmm, it's already been seen to:
Third, if you have a lot of strings that you absolutely need, or large arrays of data that do not change, then use the PROGMEM directive. This is a way of telling the Arduino to put data into Flash (program) memory only, without copying it into RAM. This technique is useful if you have a lot of data that does not change, and still have Flash (program) memory available.
The quotes are from an excellent article by Gian Pablo, Making the most of Arduino memory:http://itp.nyu.edu/~gpv206/2008/04/making_the_most_of_arduino_mem.html
Long ago I remember when VM was taught as used to make 1k of RAM seem like 16k. Don't laugh (so okay I did!), that was back in the day when the dinosaurs ruled and school texts still taught decade-old techniques.
Perhaps a VM library to be used alongside the SD library?