I have a small app that is handling large(ish) file uploads, around
150-200Mb, it’s been running for about a year now.
I’m running Rails 2.3.10, Thin 1.2.7, and Paperclip 2.3.5
Last week I went through and updated Rails from 2.3.5 to 2.3.10 and
started to use the nginx upload module (http://www.grid.net.ru/nginx/
upload.en.html) to handle the uploading of the file, then pass the
params to Paperclip to take some of the load off of Ruby for parsing
the uploads. I thought this would solve the problem, but it hasn’t
It’s working well and uploads are taking place much quicker. However,
after uploading a file, the memory usage of the Thin process jumps WAY
up and never comes back down. Memory goes from about 46-47Mb while
just surfing around the site and creating normal assets, to about
225+Mb after uploading a video and never drops.
The only thing I can think of is that it may be re-parsing the file
when Paperclip tries to get its metadata (content_type, size, etc.).
Even if that were the case, I would expect memory to go back to normal
I’m still very new to programming, and I’m looking for suggestions on
how to track down where the leak is happening. Any suggestions are