Well, it seems like it was a memory leak caused by opening all those files and then never closing them again. I blame the confusing way C frees memory... or doesn't.
As you can see here they never free the entry object:
http://arduino.cc/en/Reference/FileRewindDirectory
But I think what's happening is the compiler frees the object when it goes out of scope, but not when you overwrite it (I've gotten too used to languages that have full garbage collection) and they wrote the example using recursion which just happens to make it so each entry object is automatically deleted as it's used. In my case, I was looping inside a function, and never closed the files, so only the last file would ever go out of scope... and even that depended on where I allocated it.
As you can see here they never free the entry object:
http://arduino.cc/en/Reference/FileRewindDirectory
But I think what's happening is the compiler frees the object when it goes out of scope, but not when you overwrite it (I've gotten too used to languages that have full garbage collection) and they wrote the example using recursion which just happens to make it so each entry object is automatically deleted as it's used. In my case, I was looping inside a function, and never closed the files, so only the last file would ever go out of scope... and even that depended on where I allocated it.