Getting "java.io.IOException: error=12, Cannot allocate memory" from exception notification plugin

Hello,

I’ve recently purchased a VPS hosting package to use for the web app
I’ve
been developing the last several months. I’ve been trying to configure
everything properly, but I’m having an issue with the exception
notification
plugin. It was working before, but now it’s not. I’ve been tweaking my
java heap size settings in catalina.sh, and I thought that might be
causing
the problem since it’s a memory error. I tried setting things back to
what
they were (or at least, what I thought they were), but I’m still having
this
problem. The output written to my log file is below.

Can anyone help? I’m not sure how to go about troubleshooting this.
Also,
keep in mind that I’m a total linux noob…

Thanks,
Myron

ActionView::TemplateError (Cannot run program “/bin/sh” (in directory
“/var/tomcat6/webapps/ROOT/WEB-INF”): java.io.IOException: error=12,
Cannot
allocate memory) on line #7 of
vendor/plugins/exception_notification/views/exception_notifier/_environment.rhtml:
4: <% end -%>
5:
6: * Process: <%= $$ %>
7: * Server : <%= hostname -s.chomp %>

vendor/plugins/exception_notification/views/exception_notifier/_environment.rhtml:7:in
``’

vendor/plugins/exception_notification/views/exception_notifier/_environment.rhtml:7:in
_run_erb_47vendor47plugins47exception_notification47views47exception_notifier47_environment46rhtml' vendor/rails/actionpack/lib/action_view/base.rb:637:incompile_and_render_template’
vendor/rails/actionpack/lib/action_view/base.rb:365:in
render_template' vendor/rails/actionpack/lib/action_view/base.rb:316:inrender_file’
vendor/rails/actionpack/lib/action_view/base.rb:348:in `render’

vendor/plugins/active_scaffold/lib/extensions/action_view_rendering.rb:60:in
`render_with_active_scaffold’

vendor/plugins/exception_notification/lib/exception_notifier_helper.rb:41:in
`render_overridable’

vendor/plugins/exception_notification/lib/exception_notifier_helper.rb:30:in
`render_section’

vendor/plugins/exception_notification/views/exception_notifier/exception_notification.rhtml:6:in
`_run_erb_47vendor47plugins47exception_notification47views47exception_notifier47exception_notification46rhtml’

vendor/plugins/exception_notification/views/exception_notifier/exception_notification.rhtml:6:in
`map’

vendor/plugins/exception_notification/views/exception_notifier/exception_notification.rhtml:6:in
_run_erb_47vendor47plugins47exception_notification47views47exception_notifier47exception_notification46rhtml' vendor/rails/actionpack/lib/action_view/base.rb:637:incompile_and_render_template’
vendor/rails/actionpack/lib/action_view/base.rb:365:in
render_template' vendor/rails/actionpack/lib/action_view/base.rb:316:inrender_file’
vendor/rails/actionpack/lib/action_view/base.rb:348:in `render’

vendor/plugins/active_scaffold/lib/extensions/action_view_rendering.rb:60:in
render_with_active_scaffold' vendor/rails/actionmailer/lib/action_mailer/base.rb:502:inrender’
vendor/rails/actionmailer/lib/action_mailer/base.rb:494:in
render_message' vendor/rails/actionmailer/lib/action_mailer/base.rb:442:increate!’
vendor/rails/actionmailer/lib/action_mailer/base.rb:403:in
initialize' vendor/rails/actionmailer/lib/action_mailer/base.rb:352:innew’
vendor/rails/actionmailer/lib/action_mailer/base.rb:352:in
method_missing' vendor/plugins/exception_notification/lib/exception_notifiable.rb:95:inrescue_action_in_public’
vendor/rails/actionpack/lib/action_controller/rescue.rb:125:in
rescue_action' vendor/rails/actionpack/lib/action_controller/rescue.rb:203:inperform_action_with_rescue’
vendor/rails/actionpack/lib/action_controller/caching.rb:678:in
`perform_action_with_caching’

vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in
cache' vendor/rails/activerecord/lib/active_record/query_cache.rb:8:incache’
vendor/rails/actionpack/lib/action_controller/caching.rb:677:in
perform_action_with_caching' vendor/rails/actionpack/lib/action_controller/base.rb:524:inprocess’
vendor/rails/actionpack/lib/action_controller/filters.rb:685:in
`process_with_filters’

vendor/rails/actionpack/lib/action_controller/session_management.rb:123:in
process_with_session_management_support' vendor/rails/actionpack/lib/action_controller/base.rb:388:inprocess’
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:171:in
handle_request' vendor/rails/actionpack/lib/action_controller/dispatcher.rb:115:indispatch’
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:126:in
dispatch_cgi' vendor/rails/actionpack/lib/action_controller/dispatcher.rb:9:indispatch’

file:/var/tomcat6/webapps/ROOT/WEB-INF/lib/jruby-rack-0.9.1.jar!/rack/adapter/rails.rb:37:in
`serve_rails’

file:/var/tomcat6/webapps/ROOT/WEB-INF/lib/jruby-rack-0.9.1.jar!/rack/adapter/rails.rb:44:in
`call’

file:/var/tomcat6/webapps/ROOT/WEB-INF/lib/jruby-rack-0.9.1.jar!/jruby/rack/rails.rb:141:in
`call’

file:/var/tomcat6/webapps/ROOT/WEB-INF/lib/jruby-rack-0.9.1.jar!/rack/handler/servlet.rb:17:in
`call’
:3

My first guess is that you might want to check swap space – if you’re
filling up your temp directories, fork will fail to create a
subprocess in which to run the shell script. That’s usually the reason
for IOExceptions when trying to do a system call. The exact behavior
might be a little different on Linux but I’ve definitely seen similar
problems on Solaris.

/Nick

On Wed, Aug 20, 2008 at 12:25 PM, Myron M.
[email protected] wrote:

4: <% end -%>
vendor/rails/actionpack/lib/action_view/base.rb:637:in

_run_erb_47vendor47plugins47exception_notification47views47exception_notifier47exception_notification46rhtml' render_message’
perform_action_with_rescue' process_with_filters’
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:9:in

file:/var/tomcat6/webapps/ROOT/WEB-INF/lib/jruby-rack-0.9.1.jar!/rack/handler/servlet.rb:17:in
`call’
:3


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Thanks for the suggestion, Nick.

My VPS doesn’t provide any swap space. On the VPS FAQ for my hosting
provider, they have an item that says:

*Can I have swap enabled, because my application requires it ?
*No, swap space cannot be enabled on VPS. If your application requires
swap
to be present, please send us a support ticket, and we will mimic the
swap
for the application needs.

Is this typical? This it the first time I’ve really worked with a VPS
hosting package and done linux admin myself.

I think I have plenty of free memory, anyway. When I use “free” it
tells me
I have more than 128 MB free.

Any other ideas?

  • Myron

Hi Myron,

I am facing same issue with tomcat, but probably I am using the same
hosting provider and their vps plans. (Considering the faq you have
mentioned).
Could you find any solution to this problem?

Abdul Wahid

Myron M. wrote:

Thanks for the suggestion, Nick.

My VPS doesn’t provide any swap space. On the VPS FAQ for my hosting
provider, they have an item that says:

*Can I have swap enabled, because my application requires it ?
*No, swap space cannot be enabled on VPS. If your application requires
swap
to be present, please send us a support ticket, and we will mimic the
swap
for the application needs.

Is this typical? This it the first time I’ve really worked with a VPS
hosting package and done linux admin myself.

I think I have plenty of free memory, anyway. When I use “free” it
tells me
I have more than 128 MB free.

Any other ideas?

  • Myron