<headius[m]>
We should never raise a Java trace from a ruby core method if we can avoid it
zingo777[m] has joined #jruby
<zingo777[m]>
hi folks, i am looking for any suggestions around calling shell commands from jruby -- im observing in a jruby rails app of mine that a simple system command called using `backticks` sometimes triggers a Errno::ENOMEM error.
<zingo777[m]>
however, the posix-spawn gem is not supported in jruby https://github.com/rtomayko/posix-spawn/pull/41#issuecomment-89401569 . im unable to find any info about if there is an alternate solution to this type of issue for jruby, and thought i would ask yall experts! many thanks in advance
<zingo777[m]>
* hi folks, i am looking for any suggestions around calling shell commands from jruby -- im observing in a jruby rails app of mine that a simple system command called using backticks sometimes triggers a `Errno::ENOMEM` error.
<zingo777[m]>
however, the posix-spawn gem is not supported in jruby https://github.com/rtomayko/posix-spawn/pull/41#issuecomment-89401569 . im unable to find any info about if there is an alternate solution to this type of issue for jruby, and thought i would ask yall experts! many thanks in advance
zacts_ has joined #jruby
zacts_ has quit [Client Quit]
zacts_ has joined #jruby
zacts_ is now known as zacts
zacts has quit [Client Quit]
zacts has joined #jruby
<headius[m]>
This may be fixed by updating your glibc
<headius[m]>
Newer versions have improved posix_spawn to use vfork more often, reducing the committed memory for the child
<headius[m]>
An alternative workaround may be to launch those subcommands using a shell, which may have a similar feature
<headius[m]>
zingo777: to clarify, jruby uses posix_spawn internally for launching processes, but some versions are more efficient than others
<zingo777[m]>
thank you headius , thats helpful! is there a specific method of launching processes that's recommended for efficient memory use? (there's so many ways to launch processes in ruby). i don't need any special features other than to block/wait on the call
zacts has quit [Quit: leaving]
zacts has joined #jruby
zacts has quit [Quit: leaving]
zacts has joined #jruby
Liothen has quit [Ping timeout: 260 seconds]
Liothen has joined #jruby
zacts has quit [Quit: leaving]
zacts has joined #jruby
zacts has quit [Quit: leaving]
zacts has joined #jruby
zacts has quit [Quit: leaving]
ur5us has joined #jruby
zacts has joined #jruby
zacts has quit [Quit: leaving]
zacts has joined #jruby
zacts has quit [Quit: leaving]
ur5us has quit [Ping timeout: 260 seconds]
<headius[m]>
zingo777: spawn is the recommended Ruby way. If posix_spawn is not using vfork, then using the Java process API might be better but I think it is still just a fork and not a vfork
ur5us has joined #jruby
<headius[m]>
And Java Process is a bit harder to work with than doing it in Ruby (streams are not direct, can't control redirects as easily)
<headius[m]>
I need to look at posix_spawn gem to see if it can support JRuby using the posix_spawn binding we already ship with