title: Why do objects sent with send_data seem to be kept in memory?
body: <p>I'm building a Rails app (5.0.4, Ruby 2.3.3) that creates a PDF file with Prawn, and sends it to the user, using ActionController's send_data, like this:</p>
  
  <pre><code> # data is a Prawn document    
   send_data data, type: 'application/pdf', disposition: 'inline', filename: 'document.pdf'
  </code></pre>
  
  <p>I've noticed on Heroku that the app seems to be using more and more memory with each document that is created and sent. I confirmed this on my local machine with some crude tests. Now, I placed <code>GC.start</code> after the <code>send_data</code> call and the problem seems to be resolved. Memory always goes back to a stable level. </p>
  
  <p>My questions are, is <code>send_data</code> doing something to keep the object around for a long time? And isn't the garbage collector supposed to run "on its own" from time to time? Heroku shows a steady memory increase. Thank you. </p>