title: Is it necessary to close StringIO in ruby?
body: <p>Do we need to close StringIO objects after usage in Ruby in order to free resources, like we do with the real IO objects?</p>
  
  <pre><code>obj = StringIO.new "some string"
  #...
  obj.close # &lt;--- Do we need to close it?
  </code></pre>
  
  <p><strong>Refining my question</strong></p>
  
  <p>Closing File object is necessary because it will close the file descriptor. The number of opened files is limited in the OS, and that's why it is necessary to close File. But, if I understand correctly, StringIO is an abstraction in memory. Do we need to close it?</p>