Forum: JRuby cannot run shell scripts (cannot allocate memory)

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
László Bácsi (Guest)
on 2009-04-02 00:14
(Received via mailing list)
I'm running a Rails application with Tomcat and I keep getting this
error:

 IOError in Admin/profilesController#update

Cannot run program "/bin/sh" (in directory
"/opt/apache-tomcat-6.0.18/webapps/ROOT/WEB-INF"): java.io.IOException:
error=12, Cannot allocate memory

It doesn't happen all the time, but keeps coming back if the app has
been
running for some time. I run Tomcat with the following options:
'-Xmx384M
-Xms384M -XX:MaxPermSize=192M'. I tried to give it more memory but it
doesn't help much. And when this happens there's still a couple hundred
MB
free memory on the system.

The app runs external tools on a regular basis (imagemagick (paperclip),
indexer (sphinx), new relic rpm) so its essential for me to get this
working. Are there any magical ways to let java run these programs?

LacKac
Charles Oliver N. (Guest)
on 2009-04-02 02:43
(Received via mailing list)
László Bácsi wrote:
> I'm running a Rails application with Tomcat and I keep getting this error:
>
>  IOError in Admin/profilesController#update
>
> Cannot run program "/bin/sh" (in directory
> "/opt/apache-tomcat-6.0.18/webapps/ROOT/WEB-INF"): java.io.IOException:
> error=12, Cannot allocate memory

This error means that it's unable to open a new IO. Is it possible
you're leaking IO instances and not closing them? Be sure to close them
yourself, since otherwise they won't close until GC runs, which may not
be soon enough if you're spinning up lots of IOs.

If you're sure you're closing them, there could be a leak in something
outside your code.

Can you mail the full trace as well? Maybe we can add better logging for
these cases.

- Charlie


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
This topic is locked and can not be replied to.