I have a Rails app running in Passenger with mongo 0.9 and after a few
minutes of use, I get the following error:
NoMemoryError (failed to allocate memory):
/usr/lib/ruby/gems/1.8/gems/mongodb-mongo-0.9/lib/mongo/db.rb:
326:in `recv'
/usr/lib/ruby/gems/1.8/gems/mongodb-mongo-0.9/lib/mongo/db.rb:
326:in `receive_full'
/usr/lib/ruby/gems/1.8/gems/mongodb-mongo-0.9/lib/mongo/cursor.rb:
206:in `object_from_stream'
/usr/lib/ruby/gems/1.8/gems/mongodb-mongo-0.9/lib/mongo/cursor.rb:
191:in `next_object_on_wire'
/usr/lib/ruby/gems/1.8/gems/mongodb-mongo-0.9/lib/mongo/cursor.rb:
157:in `read_objects_off_wire'
/usr/lib/ruby/gems/1.8/gems/mongodb-mongo-0.9/lib/mongo/cursor.rb:
153:in `read_all'
/usr/lib/ruby/gems/1.8/gems/mongodb-mongo-0.9/lib/mongo/cursor.rb:
217:in `send_query_if_needed'
/usr/lib/ruby/gems/1.8/gems/mongodb-mongo-0.9/lib/mongo/cursor.rb:
195:in `refill_via_get_more'
/usr/lib/ruby/gems/1.8/gems/mongodb-mongo-0.9/lib/mongo/cursor.rb:
179:in `num_remaining'
/usr/lib/ruby/gems/1.8/gems/mongodb-mongo-0.9/lib/mongo/cursor.rb:
50:in `more?'
/usr/lib/ruby/gems/1.8/gems/mongodb-mongo-0.9/lib/mongo/cursor.rb:
116:in `to_a'
The server has 512MB of RAM. Watching `free -m` at the time of the
error shows ~250MB of free memory. We have passenger limited to 4 app
instances. After the error, the instance taking up the most memory
was using 60MB.
Any ideas?
Thanks,
Brandon