For some reason processing images (carrierwave + minimagick) stops working about a week after the service is started. There is no unusual increase in traffic or upload processes. Once the ENOMEM error occurs everything seems to 'lock up' and any following processes fail as well.
How can I 'rescue' the system once it is in that behavior or even prevent this from happening?
Some of the errors:
Errno::ENOMEM (Cannot allocate memory - export LANG=C && identify -ping /tmp/mini_magick20111219-18047-1dhmawm.jpg 2>&1):
app/uploaders/photo_uploader.rb:70:in `custom_thumbnail'
app/controllers/upload_controller.rb:186:in `process_upload'
app/middleware/flash_session_cookie_middleware.rb:17:in `call'
app/middleware/flash_session_cookie_middleware.rb:17:in `call'
Errno::ENOMEM (Cannot allocate memory - export LANG=C && mogrify -format jpg /tmp/mini_magick20111219-18047-1c43qpf.jpg 2>&1):
app/controllers/upload_controller.rb:186:in `process_upload'
app/middleware/flash_session_cookie_middleware.rb:17:in `call'
app/middleware/flash_session_cookie_middleware.rb:17:in `call'
...
...
Errno::ENOMEM (Cannot allocate memory - export LANG=C && mogrify -resize "120x180" -gravity "Center" -extent "120x120" /tmp/mini_magick20111219-18047-155ofje.jpg 2>&1):
app/controllers/upload_controller.rb:186:in `process_upload'
app/middleware/flash_session_cookie_middleware.rb:17:in `call'
app/middleware/flash_session_cookie_middleware.rb:17:in `call'
Memory and swap space info:
Mem: 8193476k total, 7907152k used, 286324k free, 5968k buffers
Swap: 12396808k total, 9494924k used, 2901884k free, 180308k cached
Version information:
- Rails 3.0.6
- ruby 1.9.2p290
- Apache 2.2.14
- passenger 3.0.9
Thank you!