Do we need to close StringIO objects after usage in Ruby in order to free resources, like we do with the real IO objects?
obj = StringIO.new \"some string\"
When you close a File, it is important as the system has a limited amount of descriptors (assuming your on a UNIX, I have no clue what Windows does). With StringIO, there is another resource at stake: Memory. If the StringIO object has a lot to store, there is going to be a lot of memory claimed from the heap. On the other hand, the garbage collector does always close IO objects that it claims, but that assumes that you have an elegant way to put your object out of scope. Also, on a heavily loaded system, physical RAM is much more valuable then file descriptors. On my Linux box, 178203 is the max file descriptors. I doubt that you could reach that.