Are you doing any image processing? If so, look at the solution proposed in this other post (use command line interface to imagemagick instead of Rmagick).
http://groups.google.com/group/heroku/browse_thread/thread/b68227df0cd05fb7 On Sep 21, 6:41 pm, jonathan <[email protected]> wrote: > I am getting these troublesome `NoMemoryError: failed to allocate > memory` errors. > > What is the best way to track down memory leaks on heroku? > > Is there a way to print our the dyno memory usage while logging? > > For those that want to know the specific issues that I am having, I am > having two ... > > (1) Memcached / Dalli, throws this on fetch > > @ad_option = Rails.cache.fetch(generate_key(:ad_option), expires_in: > 1.minute) do > @ad.random_ad_option > end > > See stack trace 1 below, > > and (2) Mongoid / Mongo, throws this on a simple find > > @ad = Ad.find(params[:ad_id]) > > See stack trace 2 below. > > Any help will be greatly appreciated! > > -- jonathan > > Stack Trace 1 ========= > .bundle/gems/ruby/1.9.1/gems/dalli-1.1.2/lib/dalli/server.rb:262:in > `dump' > > .bundle/gems/ruby/1.9.1/gems/dalli-1.1.2/lib/dalli/server.rb:262:in > `serialize' > > .bundle/gems/ruby/1.9.1/gems/dalli-1.1.2/lib/dalli/server.rb:155:in > `set' > > .bundle/gems/ruby/1.9.1/gems/dalli-1.1.2/lib/dalli/server.rb:46:in > `request' > > .bundle/gems/ruby/1.9.1/gems/dalli-1.1.2/lib/dalli/options.rb:18:in > `block in request' > > /usr/ruby1.9.2/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize' > > .bundle/gems/ruby/1.9.1/gems/dalli-1.1.2/lib/dalli/options.rb:17:in > `request' > > .bundle/gems/ruby/1.9.1/gems/dalli-1.1.2/lib/dalli/client.rb:252:in > `perform' > > .bundle/gems/ruby/1.9.1/gems/dalli-1.1.2/lib/dalli/client.rb:132:in > `set' > > (eval):7:in `block in set_with_newrelic_trace' > > vendor/plugins/rpm/lib/new_relic/agent/method_tracer.rb:193:in > `trace_execution_scoped' > > (eval):4:in `set_with_newrelic_trace' > > .bundle/gems/ruby/1.9.1/gems/dalli-1.1.2/lib/active_support/cache/ > dalli_store.rb:138:in `write_entry' > > .bundle/gems/ruby/1.9.1/gems/activesupport-3.0.3/lib/active_support/ > cache/strategy/local_cache.rb:135:in `write_entry' > > .bundle/gems/ruby/1.9.1/gems/dalli-1.1.2/lib/active_support/cache/ > dalli_store.rb:176:in `write_entry' > > .bundle/gems/ruby/1.9.1/gems/activesupport-3.0.3/lib/active_support/ > cache.rb:364:in `block in write' > > .bundle/gems/ruby/1.9.1/gems/activesupport-3.0.3/lib/active_support/ > cache.rb:519:in `instrument' > > .bundle/gems/ruby/1.9.1/gems/activesupport-3.0.3/lib/active_support/ > cache.rb:362:in `write' > > .bundle/gems/ruby/1.9.1/gems/activesupport-3.0.3/lib/active_support/ > cache.rb:299:in `fetch' > > [PROJECT_ROOT]controllers/assets_controller.rb:37:in `load_creative' > > [PROJECT_ROOT]controllers/assets_controller.rb:13:in `show' > > Stack Trace 2 ======== > .bundle/gems/ruby/1.9.1/gems/mongo-1.3.1/lib/mongo/connection.rb: > 775:in `read_documents' > > .bundle/gems/ruby/1.9.1/gems/mongo-1.3.1/lib/mongo/connection.rb: > 727:in `receive' > > .bundle/gems/ruby/1.9.1/gems/mongo-1.3.1/lib/mongo/connection.rb: > 484:in `block in receive_message' > > : > > .bundle/gems/ruby/1.9.1/gems/mongo-1.3.1/lib/mongo/connection.rb: > 482:in `receive_message' > > .bundle/gems/ruby/1.9.1/gems/mongo-1.3.1/lib/mongo/cursor.rb:407:in > `block in send_initial_query' > > .bundle/gems/ruby/1.9.1/gems/mongo-1.3.1/lib/mongo/connection.rb: > 609:in `instrument' > > .bundle/gems/ruby/1.9.1/gems/mongo-1.3.1/lib/mongo/cursor.rb:406:in > `send_initial_query' > > .bundle/gems/ruby/1.9.1/gems/mongo-1.3.1/lib/mongo/cursor.rb:371:in > `refresh' > > .bundle/gems/ruby/1.9.1/gems/mongo-1.3.1/lib/mongo/cursor.rb:87:in > `next_document' > > .bundle/gems/ruby/1.9.1/gems/mongo-1.3.1/lib/mongo/collection.rb: > 251:in `find_one' > > .bundle/gems/ruby/1.9.1/bundler/gems/mongoid-30cb67343766/lib/mongoid/ > collections/master.rb:25:in `block in find_one' > > .bundle/gems/ruby/1.9.1/bundler/gems/mongoid-30cb67343766/lib/mongoid/ > collections/retry.rb:29:in `retry_on_connection_failure' > > .bundle/gems/ruby/1.9.1/bundler/gems/mongoid-30cb67343766/lib/mongoid/ > collections/master.rb:24:in `find_one' > > .bundle/gems/ruby/1.9.1/bundler/gems/mongoid-30cb67343766/lib/mongoid/ > collection.rb:60:in `find_one' > > .bundle/gems/ruby/1.9.1/bundler/gems/mongoid-30cb67343766/lib/mongoid/ > contexts/mongo.rb:164:in `first' > > .bundle/gems/ruby/1.9.1/bundler/gems/mongoid-30cb67343766/lib/mongoid/ > criteria.rb:43:in `one' > > .bundle/gems/ruby/1.9.1/bundler/gems/mongoid-30cb67343766/lib/mongoid/ > criterion/inclusion.rb:269:in `from_map_or_db' > > .bundle/gems/ruby/1.9.1/bundler/gems/mongoid-30cb67343766/lib/mongoid/ > criterion/inclusion.rb:250:in `execute_or_raise' > > .bundle/gems/ruby/1.9.1/bundler/gems/mongoid-30cb67343766/lib/mongoid/ > criterion/inclusion.rb:106:in `find' > > .bundle/gems/ruby/1.9.1/bundler/gems/mongoid-30cb67343766/lib/mongoid/ > finders.rb:83:in `find' -- You received this message because you are subscribed to the Google Groups "Heroku" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/heroku?hl=en.
