[Mongrel] failed to allocate memory while downloading large files

Luis Lavena luislavena at gmail.com
Tue Sep 14 07:45:27 EDT 2010


On Tue, Sep 14, 2010 at 2:49 AM, Amit Tomar <lists at ruby-forum.com> wrote:
>
> Luis ,this is how am downloading my files
>
> send_data(@data,:filename => @containerformat.name+extension,
>        :disposition => 'attachment')
> but i am getting error failed to allocate memory for large files ,for
> small files it's working fine
>

Because send_data will try to load the whole file in memory.

http://apidock.com/rails/ActionController/Streaming/send_data

Since the file is not dynamically generated, serve it directly, don't
put it behind Rails.

> and one thing more i observed while uploading large files , whenever i
> upload data more than 2gb from IE OR from mozila ,both restarts but for
> google chorme its working fine???

Neither IE or Mozilla do chunked uploads. Chrome does and mongrels
properly streams the chunked upload to a temporary file.
-- 
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry


More information about the Mongrel-users mailing list