Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8459115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T13:15:30+00:00 2026-06-10T13:15:30+00:00

I have a Rails 3 app that needs to generate an image and send

  • 0

I have a Rails 3 app that needs to generate an image and send the data to the browser.

The app must be deployed on Heroku.

However, Heroku only supports streaming through Mongrel which holds on to the memory. This then causes Heroku to slow, then kill the thread after a dozen or so requests.

https://devcenter.heroku.com/articles/error-codes#r14-memory-quota-exceeded

I am currently using send_data or send_file from ActionController::DataStreaming

http://api.rubyonrails.org/classes/ActionController/DataStreaming.html#method-i-send_data

Heroku does not support Rack::Sendfile or x-sendfile.

https://devcenter.heroku.com/articles/rack-sendfile

The project “ruby-mongrel-x-sendfile” says: “Streaming very much data through mongrel is a bad thing; springs stringy memory leaks” and provides an “in-mongrel solution”. But it doesn’t look like a good solution.

http://code.google.com/p/ruby-mongrel-x-sendfile/

A slow solution to this is to upload every file to Amazon S3 first.

Does anyone have any ideas please?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T13:15:31+00:00Added an answer on June 10, 2026 at 1:15 pm

    The answer is to start garbage collection with:

    GC.start
    

    I placed that line at the bottom of the Rails controller action after send_data.

    http://www.ruby-doc.org/core-1.9.3/GC.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a MySQL/Rails app that needs search. Here's some info about the data:
I have a rails app that needs a lot of initial data. This data
I have a Rails app that needs to expose values from a database as
I have a silverlight application that needs to talk to a rails app to
I have a Rails app that is served by Apache and Passenger, using only
I have a Ruby on Rails app that needs process many background jobs simultaneously:
I have a Ruby on Rails app that I built myself, but which needs
I am developing an app that needs to send text messages, so I have
I'm building a Rails app that needs some data visualization. What is a good
I have a simple Rails 3 blog app that needs an admin user so

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.