And then in the controller:
blob = Blob.create :data => uploaded_file.read
When /files/podcast.mp3 is 32 megabytes and I run the test, memory
spikes hugely. My laptop quickly began swapping out memory and became
unusable. top showed the memory usage of the Ruby process to be about
400MB and growing.
When /files/podcast.mp3 is 32 megabytes and I run the test, memory
spikes hugely. My laptop quickly began swapping out memory and became
unusable. top showed the memory usage of the Ruby process to be about
400MB and growing.
Is there something stupid that I’m doing?
Are you using a blob field type rather than the postgresql large
objects?
-Robby
Robby R.
Founder & Executive Director
PLANET ARGON, LLC
Ruby on Rails Development, Consulting & Hosting
When /files/podcast.mp3 is 32 megabytes and I run the test, memory
spikes hugely. My laptop quickly began swapping out memory and became
unusable. top showed the memory usage of the Ruby process to be about
400MB and growing.
Is there something stupid that I’m doing?
Perhaps consider using the file_column extension instead of storing the
files
in the database:
in the database:
to as high as 500mb and stays there.
One thing I have noticed is that manually invoking the garbage collector via
GC.start right after the upload brings memory down to 100mb.
I don’t seem to have received the earlier messages in this thread…
There was some discussion of ActiveRecord’s memory use when handling
BLOBs over a year ago, triggered by this article:
in a thread “Improving ActiveRecord Part 1” started at 8:09pm on 24th
May 2005. I don’t know if things have changed, but the article pointed
out how Rails made multiple copies of large data items on their way to
the database.
That wouldn’t explain why memory use continues to grow, though.
I’m also having this issue with a MYSQL database. Before the upload, my
ruby
process memory is at 19-22mb. When I upload a 37mb file, memory soon
increases
to as high as 500mb and stays there.
One thing I have noticed is that manually invoking the garbage collector
via
GC.start right after the upload brings memory down to 100mb.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.