# Large file upload crash rails app

**URL:** <https://www.ruby-forum.com/t/large-file-upload-crash-rails-app/80702>\
**Category:** Rails\
**Created:** [December 30, 2006, 3:02am UTC](https://www.ruby-forum.com/t/large-file-upload-crash-rails-app/80702 "2006-12-30T03:02:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bithai80](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/d26b3c/32.png) [@bithai80](https://www.ruby-forum.com/u/bithai80)\
**Post date:** [December 30, 2006, 3:02am UTC](https://www.ruby-forum.com/t/large-file-upload-crash-rails-app/80702/1 "2006-12-30T03:02:33Z")

</div>

when uploading a large file (8meg) to my live deployed railsapp website  
( [www.lifehoo.com](http://www.lifehoo.com) ) hosted on textdrive, it crashes the railsapp.

Is there a way in rubyrails to prevent this from happening?

---

<div class="post-metadata">

**Author:** ![bithai80](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/d26b3c/32.png) [@bithai80](https://www.ruby-forum.com/u/bithai80)\
**Post date:** [December 30, 2006, 11:21pm UTC](https://www.ruby-forum.com/t/large-file-upload-crash-rails-app/80702/2 "2006-12-30T23:21:34Z")

</div>

Hi Truong,

Please paste your exception details, it is very hard to guess (maybe  
Zed S. can do some telepathic assistance, i heard he can do anything  
regarding rails 🙂 )

---

<div class="post-metadata">

**Author:** ![bithai80](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/d26b3c/32.png) [@bithai80](https://www.ruby-forum.com/u/bithai80)\
**Post date:** [December 31, 2006, 7:09pm UTC](https://www.ruby-forum.com/t/large-file-upload-crash-rails-app/80702/3 "2006-12-31T19:09:28Z")

</div>

Elad M. wrote:

> Hi Truong,
> 
> Please paste your exception details, it is very hard to guess (maybe  
> Zed S. can do some telepathic assistance, i heard he can do anything  
> regarding rails 🙂 )

Hi, production.log and fastcgi.crash.log doesn’t show anything.

however, while logging in via ssh shell, I noticed this:

RMagick: Memory allocation failed `Cannot allocate memory’.

Any suggestions?

Thanks!

---

<div class="post-metadata">

**Author:** ![bithai80](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/d26b3c/32.png) [@bithai80](https://www.ruby-forum.com/u/bithai80)\
**Post date:** [December 31, 2006, 7:19pm UTC](https://www.ruby-forum.com/t/large-file-upload-crash-rails-app/80702/4 "2006-12-31T19:19:08Z")

</div>

Truong-an Thai wrote:

> Hi, production.log and fastcgi.crash.log doesn’t show anything.
> 
> however, while logging in via ssh shell, I noticed this:
> 
> RMagick: Memory allocation failed `Cannot allocate memory’.
> 
> Any suggestions?

My best guess would be to add some more RAM to the machine. Or in some  
other way make more memory available to the process.

–  
Jakob S. - [http://mentalized.net](http://mentalized.net)

---

<div class="post-metadata">

**Author:** ![bithai80](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/d26b3c/32.png) [@bithai80](https://www.ruby-forum.com/u/bithai80)\
**Post date:** [January 1, 2007, 2:03pm UTC](https://www.ruby-forum.com/t/large-file-upload-crash-rails-app/80702/5 "2007-01-01T14:03:11Z")

</div>

On 31 Dec 2006, at 19:17, Jakob S. wrote:

> Truong-an Thai wrote:
> 
> > Hi, production.log and fastcgi.crash.log doesn’t show anything.  
> > however, while logging in via ssh shell, I noticed this:  
> > RMagick: Memory allocation failed `Cannot allocate memory’.  
> > Any suggestions?
> 
> My best guess would be to add some more RAM to the machine. Or in  
> some other way make more memory available to the process.

The problem with shared hosts is that your memory is limited. As soon  
as you go over a certain treshold, it just terminates your processes.  
I’m having similar problems with uploads and even downloads via  
send\_file on a2hosting’s servers. The shell also reads: out of  
memory, my processes are all killed (including mongrel, the site goes  
offline) and a core file is dumped. The same application runs without  
a problem on our VPS or dedicated server.

Best regards

Peter De Berdt
