Discussion:
[jruby-user] JRE 7 / JRuby 1.7.13 - fatal error precompiling assets for Rails 3.2.x application
TJG
2014-07-09 02:50:32 UTC
Permalink
Environment:

Ubuntu 12.04 LTS
JRuby 1.7.13
JRE 7.0_60-b19
Rails 3.2.12 application

Hi all;

Does anyone recognize this problem or can anyone suggest what I might try
to figure out what's gone wrong?

$ *jruby -S rake assets:precompile:all RAILS_ENV=staging
RAILS_GROUPS=assets*

Starts off okay...

Compiled jquery-plugins/jquery.blockUI.js (2ms) (pid 29552)
Compiled jquery-plugins/jquery.cookie.js (2ms) (pid 29552)
Compiled jquery-plugins/jquery.form.js (13ms) (pid 29552)
Compiled jquery-plugins/jquery.safeEnter.js (0ms) (pid 29552)
Compiled ckeditor/basepath.js (16ms) (pid 29552)
Compiled ckeditor/ckeditor.js (7ms) (pid 29552)
Compiled ckeditor/jquery.js (0ms) (pid 29552)
Compiled ckeditor-jquery.js (118ms) (pid 29552)
Compiled application.js (1346ms) (pid 29552)
Compiled admin.js (1389ms) (pid 29552)

Then... boom:

#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f32b205cff1, pid=29552, tid=139855679133440
#
# JRE version: Java(TM) SE Runtime Environment (7.0_60-b19) (build
1.7.0_60-b19)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (24.60-b09 mixed mode
linux-amd64 compressed oops)
# Problematic frame:
# V [libjvm.so+0x5c2ff1] oopDesc::size_given_klass(Klass*)+0x1
#
# Failed to write core dump. Core dumps have been disabled. To enable core
dumping, try "ulimit -c unlimited" before starting Java again


[ From error dump ]:
VM Arguments:
jvm_args: -Xmx500m -Xss2048k
-Djffi.boot.library.path=/home/sshadmin/.rvm/rubies/jruby-1.7.13/lib/jni
-Xbootclasspath/a:/home/sshadmin/.rvm/rubies/jruby-1.7.13/lib/jruby.jar
-Djruby.home=/home/sshadmin/.rvm/rubies/jruby-1.7.13
-Djruby.lib=/home/sshadmin/.rvm/rubies/jruby-1.7.13/lib
-Djruby.script=jruby -Djruby.shell=/bin/sh
java_command: org.jruby.Main -S rake assets:precompile:all
RAILS_ENV=staging RAILS_GROUPS=assets
Launcher Type: SUN_STANDARD

Environment Variables:
JAVA_HOME=/usr/lib/jvm/jdk1.7.0_60
PATH=/webapps/polar/shared/bundle/jruby/1.9/bin:/home/sshadmin/.rvm/gems/jruby-1.7.13/bin:/home/sshadmin/.rvm/gems/jruby-***@global
/bin:/home/sshadmin/.rvm/rubies/jruby-1.7.13/bin:/home/sshadmin/.rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/imagemagick-6.7.2/bin:/usr/lib/postgresql/9.1/bin:/usr/lib/jvm/jdk1.7.0_60/bin
LD_LIBRARY_PATH=/usr/local/imagemagick-6.7.2/lib:/usr/local/imagemagick-6.7.2/lib:/usr/local/imagemagick-6.7.2/lib
SHELL=/bin/bash


Many thanks,
Tim
TJG
2014-07-13 15:50:38 UTC
Permalink
Resolved this by installing *node.js* on the server, and dropping
*therubyrhino* gem.

Asset precompilation worked nicely, with no JVM segmentation faults.

And, on y development machine, asset precompilation dropped from 2 *hours*
to 7 *minutes*.

T
Post by TJG
Ubuntu 12.04 LTS
JRuby 1.7.13
JRE 7.0_60-b19
Rails 3.2.12 application
Hi all;
Does anyone recognize this problem or can anyone suggest what I might try
to figure out what's gone wrong?
$ *jruby -S rake assets:precompile:all RAILS_ENV=staging
RAILS_GROUPS=assets*
Starts off okay...
Compiled jquery-plugins/jquery.blockUI.js (2ms) (pid 29552)
Compiled jquery-plugins/jquery.cookie.js (2ms) (pid 29552)
Compiled jquery-plugins/jquery.form.js (13ms) (pid 29552)
Compiled jquery-plugins/jquery.safeEnter.js (0ms) (pid 29552)
Compiled ckeditor/basepath.js (16ms) (pid 29552)
Compiled ckeditor/ckeditor.js (7ms) (pid 29552)
Compiled ckeditor/jquery.js (0ms) (pid 29552)
Compiled ckeditor-jquery.js (118ms) (pid 29552)
Compiled application.js (1346ms) (pid 29552)
Compiled admin.js (1389ms) (pid 29552)
#
#
# SIGSEGV (0xb) at pc=0x00007f32b205cff1, pid=29552, tid=139855679133440
#
# JRE version: Java(TM) SE Runtime Environment (7.0_60-b19) (build
1.7.0_60-b19)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (24.60-b09 mixed mode
linux-amd64 compressed oops)
# V [libjvm.so+0x5c2ff1] oopDesc::size_given_klass(Klass*)+0x1
#
# Failed to write core dump. Core dumps have been disabled. To enable core
dumping, try "ulimit -c unlimited" before starting Java again
jvm_args: -Xmx500m -Xss2048k
-Djffi.boot.library.path=/home/sshadmin/.rvm/rubies/jruby-1.7.13/lib/jni
-Xbootclasspath/a:/home/sshadmin/.rvm/rubies/jruby-1.7.13/lib/jruby.jar
-Djruby.home=/home/sshadmin/.rvm/rubies/jruby-1.7.13
-Djruby.lib=/home/sshadmin/.rvm/rubies/jruby-1.7.13/lib
-Djruby.script=jruby -Djruby.shell=/bin/sh
java_command: org.jruby.Main -S rake assets:precompile:all
RAILS_ENV=staging RAILS_GROUPS=assets
Launcher Type: SUN_STANDARD
JAVA_HOME=/usr/lib/jvm/jdk1.7.0_60
/bin:/home/sshadmin/.rvm/rubies/jruby-1.7.13/bin:/home/sshadmin/.rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/imagemagick-6.7.2/bin:/usr/lib/postgresql/9.1/bin:/usr/lib/jvm/jdk1.7.0_60/bin
LD_LIBRARY_PATH=/usr/local/imagemagick-6.7.2/lib:/usr/local/imagemagick-6.7.2/lib:/usr/local/imagemagick-6.7.2/lib
SHELL=/bin/bash
Many thanks,
Tim
Christian MICHON
2014-07-13 17:25:13 UTC
Permalink
Moving from jruby to nodejs? Therubyrhino gem?

Could you please then explain your architecture? It's extremely unclear
from your 2 emails.

On 1st email I can see you allocated only 500Mb to your jruby job. I would
advise for 1.5Gb if you're stuck on 32 bits, 2Gb and above if you're on 64
bits.
Post by TJG
Resolved this by installing *node.js* on the server, and dropping
*therubyrhino* gem.
Asset precompilation worked nicely, with no JVM segmentation faults.
And, on y development machine, asset precompilation dropped from 2 *hours*
to 7 *minutes*.
T
Post by TJG
Ubuntu 12.04 LTS
JRuby 1.7.13
JRE 7.0_60-b19
Rails 3.2.12 application
Hi all;
Does anyone recognize this problem or can anyone suggest what I might try
to figure out what's gone wrong?
$ *jruby -S rake assets:precompile:all RAILS_ENV=staging
RAILS_GROUPS=assets*
Starts off okay...
Compiled jquery-plugins/jquery.blockUI.js (2ms) (pid 29552)
Compiled jquery-plugins/jquery.cookie.js (2ms) (pid 29552)
Compiled jquery-plugins/jquery.form.js (13ms) (pid 29552)
Compiled jquery-plugins/jquery.safeEnter.js (0ms) (pid 29552)
Compiled ckeditor/basepath.js (16ms) (pid 29552)
Compiled ckeditor/ckeditor.js (7ms) (pid 29552)
Compiled ckeditor/jquery.js (0ms) (pid 29552)
Compiled ckeditor-jquery.js (118ms) (pid 29552)
Compiled application.js (1346ms) (pid 29552)
Compiled admin.js (1389ms) (pid 29552)
#
#
# SIGSEGV (0xb) at pc=0x00007f32b205cff1, pid=29552, tid=139855679133440
#
# JRE version: Java(TM) SE Runtime Environment (7.0_60-b19) (build
1.7.0_60-b19)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (24.60-b09 mixed mode
linux-amd64 compressed oops)
# V [libjvm.so+0x5c2ff1] oopDesc::size_given_klass(Klass*)+0x1
#
# Failed to write core dump. Core dumps have been disabled. To enable
core dumping, try "ulimit -c unlimited" before starting Java again
jvm_args: -Xmx500m -Xss2048k
-Djffi.boot.library.path=/home/sshadmin/.rvm/rubies/jruby-1.7.13/lib/jni
-Xbootclasspath/a:/home/sshadmin/.rvm/rubies/jruby-1.7.13/lib/jruby.jar
-Djruby.home=/home/sshadmin/.rvm/rubies/jruby-1.7.13
-Djruby.lib=/home/sshadmin/.rvm/rubies/jruby-1.7.13/lib
-Djruby.script=jruby -Djruby.shell=/bin/sh
java_command: org.jruby.Main -S rake assets:precompile:all
RAILS_ENV=staging RAILS_GROUPS=assets
Launcher Type: SUN_STANDARD
JAVA_HOME=/usr/lib/jvm/jdk1.7.0_60
/bin:/home/sshadmin/.rvm/rubies/jruby-1.7.13/bin:/home/sshadmin/.rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/imagemagick-6.7.2/bin:/usr/lib/postgresql/9.1/bin:/usr/lib/jvm/jdk1.7.0_60/bin
LD_LIBRARY_PATH=/usr/local/imagemagick-6.7.2/lib:/usr/local/imagemagick-6.7.2/lib:/usr/local/imagemagick-6.7.2/lib
SHELL=/bin/bash
Many thanks,
Tim
TJG
2014-07-13 17:33:16 UTC
Permalink
Salut Christian;

Thanks for your observation about the memory allocation. Perhaps that was
the original problem.

No, I didn't move my project from JRuby to nodejs. I just removed
therubyrhino javascript interpreter and now let the precompilation of
assets depend on node.js instead
https://github.com/sstephenson/execjs#readme

I do not understand the mechanics of it all, yet, but this change was
certainly a life-saver.

With no other changes (i.e. no increased memory or anything like that), my
assets now precompile without failure by the JVM.


Tim



On Sun, Jul 13, 2014 at 1:25 PM, Christian MICHON <
Post by Christian MICHON
Moving from jruby to nodejs? Therubyrhino gem?
Could you please then explain your architecture? It's extremely unclear
from your 2 emails.
On 1st email I can see you allocated only 500Mb to your jruby job. I would
advise for 1.5Gb if you're stuck on 32 bits, 2Gb and above if you're on 64
bits.
Post by TJG
Resolved this by installing *node.js* on the server, and dropping
*therubyrhino* gem.
Asset precompilation worked nicely, with no JVM segmentation faults.
And, on y development machine, asset precompilation dropped from 2
*hours* to 7 *minutes*.
T
Post by TJG
Ubuntu 12.04 LTS
JRuby 1.7.13
JRE 7.0_60-b19
Rails 3.2.12 application
Hi all;
Does anyone recognize this problem or can anyone suggest what I might
try to figure out what's gone wrong?
$ *jruby -S rake assets:precompile:all RAILS_ENV=staging
RAILS_GROUPS=assets*
Starts off okay...
Compiled jquery-plugins/jquery.blockUI.js (2ms) (pid 29552)
Compiled jquery-plugins/jquery.cookie.js (2ms) (pid 29552)
Compiled jquery-plugins/jquery.form.js (13ms) (pid 29552)
Compiled jquery-plugins/jquery.safeEnter.js (0ms) (pid 29552)
Compiled ckeditor/basepath.js (16ms) (pid 29552)
Compiled ckeditor/ckeditor.js (7ms) (pid 29552)
Compiled ckeditor/jquery.js (0ms) (pid 29552)
Compiled ckeditor-jquery.js (118ms) (pid 29552)
Compiled application.js (1346ms) (pid 29552)
Compiled admin.js (1389ms) (pid 29552)
#
#
# SIGSEGV (0xb) at pc=0x00007f32b205cff1, pid=29552, tid=139855679133440
#
# JRE version: Java(TM) SE Runtime Environment (7.0_60-b19) (build
1.7.0_60-b19)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (24.60-b09 mixed mode
linux-amd64 compressed oops)
# V [libjvm.so+0x5c2ff1] oopDesc::size_given_klass(Klass*)+0x1
#
# Failed to write core dump. Core dumps have been disabled. To enable
core dumping, try "ulimit -c unlimited" before starting Java again
jvm_args: -Xmx500m -Xss2048k
-Djffi.boot.library.path=/home/sshadmin/.rvm/rubies/jruby-1.7.13/lib/jni
-Xbootclasspath/a:/home/sshadmin/.rvm/rubies/jruby-1.7.13/lib/jruby.jar
-Djruby.home=/home/sshadmin/.rvm/rubies/jruby-1.7.13
-Djruby.lib=/home/sshadmin/.rvm/rubies/jruby-1.7.13/lib
-Djruby.script=jruby -Djruby.shell=/bin/sh
java_command: org.jruby.Main -S rake assets:precompile:all
RAILS_ENV=staging RAILS_GROUPS=assets
Launcher Type: SUN_STANDARD
JAVA_HOME=/usr/lib/jvm/jdk1.7.0_60
/bin:/home/sshadmin/.rvm/rubies/jruby-1.7.13/bin:/home/sshadmin/.rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/imagemagick-6.7.2/bin:/usr/lib/postgresql/9.1/bin:/usr/lib/jvm/jdk1.7.0_60/bin
LD_LIBRARY_PATH=/usr/local/imagemagick-6.7.2/lib:/usr/local/imagemagick-6.7.2/lib:/usr/local/imagemagick-6.7.2/lib
SHELL=/bin/bash
Many thanks,
Tim
Chris Seaton
2014-07-13 17:37:39 UTC
Permalink
Rhino is not a fast implementation of JS - whether or not it’s integrated into JRuby via therubyrhino. Is anyone working on a therubynashorn yet?

Chris
Post by TJG
Salut Christian;
Thanks for your observation about the memory allocation. Perhaps that was the original problem.
No, I didn't move my project from JRuby to nodejs. I just removed therubyrhino javascript interpreter and now let the precompilation of assets depend on node.js instead
https://github.com/sstephenson/execjs#readme
I do not understand the mechanics of it all, yet, but this change was certainly a life-saver.
With no other changes (i.e. no increased memory or anything like that), my assets now precompile without failure by the JVM.
Tim
Moving from jruby to nodejs? Therubyrhino gem?
Could you please then explain your architecture? It's extremely unclear from your 2 emails.
On 1st email I can see you allocated only 500Mb to your jruby job. I would advise for 1.5Gb if you're stuck on 32 bits, 2Gb and above if you're on 64 bits.
Resolved this by installing node.js on the server, and dropping therubyrhino gem.
Asset precompilation worked nicely, with no JVM segmentation faults.
And, on y development machine, asset precompilation dropped from 2 hours to 7 minutes.
T
Ubuntu 12.04 LTS
JRuby 1.7.13
JRE 7.0_60-b19
Rails 3.2.12 application
Hi all;
Does anyone recognize this problem or can anyone suggest what I might try to figure out what's gone wrong?
$ jruby -S rake assets:precompile:all RAILS_ENV=staging RAILS_GROUPS=assets
Starts off okay...
Compiled jquery-plugins/jquery.blockUI.js (2ms) (pid 29552)
Compiled jquery-plugins/jquery.cookie.js (2ms) (pid 29552)
Compiled jquery-plugins/jquery.form.js (13ms) (pid 29552)
Compiled jquery-plugins/jquery.safeEnter.js (0ms) (pid 29552)
Compiled ckeditor/basepath.js (16ms) (pid 29552)
Compiled ckeditor/ckeditor.js (7ms) (pid 29552)
Compiled ckeditor/jquery.js (0ms) (pid 29552)
Compiled ckeditor-jquery.js (118ms) (pid 29552)
Compiled application.js (1346ms) (pid 29552)
Compiled admin.js (1389ms) (pid 29552)
#
#
# SIGSEGV (0xb) at pc=0x00007f32b205cff1, pid=29552, tid=139855679133440
#
# JRE version: Java(TM) SE Runtime Environment (7.0_60-b19) (build 1.7.0_60-b19)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (24.60-b09 mixed mode linux-amd64 compressed oops)
# V [libjvm.so+0x5c2ff1] oopDesc::size_given_klass(Klass*)+0x1
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
jvm_args: -Xmx500m -Xss2048k -Djffi.boot.library.path=/home/sshadmin/.rvm/rubies/jruby-1.7.13/lib/jni -Xbootclasspath/a:/home/sshadmin/.rvm/rubies/jruby-1.7.13/lib/jruby.jar -Djruby.home=/home/sshadmin/.rvm/rubies/jruby-1.7.13 -Djruby.lib=/home/sshadmin/.rvm/rubies/jruby-1.7.13/lib -Djruby.script=jruby -Djruby.shell=/bin/sh
java_command: org.jruby.Main -S rake assets:precompile:all RAILS_ENV=staging RAILS_GROUPS=assets
Launcher Type: SUN_STANDARD
JAVA_HOME=/usr/lib/jvm/jdk1.7.0_60
LD_LIBRARY_PATH=/usr/local/imagemagick-6.7.2/lib:/usr/local/imagemagick-6.7.2/lib:/usr/local/imagemagick-6.7.2/lib
SHELL=/bin/bash
Many thanks,
Tim
Christian MICHON
2014-07-13 17:41:00 UTC
Permalink
An excellent idea. Careful though: JDK8 is mandatory for Nashorn.

And I understood just now why therubyrhino: rails complex stack for asset
compilation. Why not sprockets instead?
Rhino is not a fast implementation of JS - whether or not it’s integrated
into JRuby via therubyrhino. Is anyone working on a therubynashorn yet?
Chris
Salut Christian;
Thanks for your observation about the memory allocation. Perhaps that was
the original problem.
No, I didn't move my project from JRuby to nodejs. I just removed
therubyrhino javascript interpreter and now let the precompilation of
assets depend on node.js instead
https://github.com/sstephenson/execjs#readme
I do not understand the mechanics of it all, yet, but this change was
certainly a life-saver.
With no other changes (i.e. no increased memory or anything like that), my
assets now precompile without failure by the JVM.
Tim
On Sun, Jul 13, 2014 at 1:25 PM, Christian MICHON <
Post by Christian MICHON
Moving from jruby to nodejs? Therubyrhino gem?
Could you please then explain your architecture? It's extremely unclear
from your 2 emails.
On 1st email I can see you allocated only 500Mb to your jruby job. I
would advise for 1.5Gb if you're stuck on 32 bits, 2Gb and above if you're
on 64 bits.
Post by TJG
Resolved this by installing *node.js* on the server, and dropping
*therubyrhino* gem.
Asset precompilation worked nicely, with no JVM segmentation faults.
And, on y development machine, asset precompilation dropped from 2
*hours* to 7 *minutes*.
T
Post by TJG
Ubuntu 12.04 LTS
JRuby 1.7.13
JRE 7.0_60-b19
Rails 3.2.12 application
Hi all;
Does anyone recognize this problem or can anyone suggest what I might
try to figure out what's gone wrong?
$ *jruby -S rake assets:precompile:all RAILS_ENV=staging
RAILS_GROUPS=assets*
Starts off okay...
Compiled jquery-plugins/jquery.blockUI.js (2ms) (pid 29552)
Compiled jquery-plugins/jquery.cookie.js (2ms) (pid 29552)
Compiled jquery-plugins/jquery.form.js (13ms) (pid 29552)
Compiled jquery-plugins/jquery.safeEnter.js (0ms) (pid 29552)
Compiled ckeditor/basepath.js (16ms) (pid 29552)
Compiled ckeditor/ckeditor.js (7ms) (pid 29552)
Compiled ckeditor/jquery.js (0ms) (pid 29552)
Compiled ckeditor-jquery.js (118ms) (pid 29552)
Compiled application.js (1346ms) (pid 29552)
Compiled admin.js (1389ms) (pid 29552)
#
#
# SIGSEGV (0xb) at pc=0x00007f32b205cff1, pid=29552,
tid=139855679133440
#
# JRE version: Java(TM) SE Runtime Environment (7.0_60-b19) (build 1.7.0_60-b19)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (24.60-b09 mixed mode
linux-amd64 compressed oops)
# V [libjvm.so+0x5c2ff1] oopDesc::size_given_klass(Klass*)+0x1
#
# Failed to write core dump. Core dumps have been disabled. To enable
core dumping, try "ulimit -c unlimited" before starting Java again
jvm_args: -Xmx500m -Xss2048k
-Djffi.boot.library.path=/home/sshadmin/.rvm/rubies/jruby-1.7.13/lib/jni
-Xbootclasspath/a:/home/sshadmin/.rvm/rubies/jruby-1.7.13/lib/jruby.jar
-Djruby.home=/home/sshadmin/.rvm/rubies/jruby-1.7.13
-Djruby.lib=/home/sshadmin/.rvm/rubies/jruby-1.7.13/lib
-Djruby.script=jruby -Djruby.shell=/bin/sh
java_command: org.jruby.Main -S rake assets:precompile:all
RAILS_ENV=staging RAILS_GROUPS=assets
Launcher Type: SUN_STANDARD
JAVA_HOME=/usr/lib/jvm/jdk1.7.0_60
/bin:/home/sshadmin/.rvm/rubies/jruby-1.7.13/bin:/home/sshadmin/.rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/imagemagick-6.7.2/bin:/usr/lib/postgresql/9.1/bin:/usr/lib/jvm/jdk1.7.0_60/bin
LD_LIBRARY_PATH=/usr/local/imagemagick-6.7.2/lib:/usr/local/imagemagick-6.7.2/lib:/usr/local/imagemagick-6.7.2/lib
SHELL=/bin/bash
Many thanks,
Tim
Alex Tambellini
2014-07-13 17:45:12 UTC
Permalink
Something that sped up our asset compilation process a ton was switching from uglifier.js to the google closure compiler:

By adding this gem to your Gemfile:

gem 'closure-compiler’

and setting the rails javascript compressor to closure compiler:

config.assets.js_compressor = :closure

https://github.com/documentcloud/closure-compiler/
Post by Christian MICHON
An excellent idea. Careful though: JDK8 is mandatory for Nashorn.
And I understood just now why therubyrhino: rails complex stack for asset compilation. Why not sprockets instead?
Rhino is not a fast implementation of JS - whether or not it’s integrated into JRuby via therubyrhino. Is anyone working on a therubynashorn yet?
Chris
Post by TJG
Salut Christian;
Thanks for your observation about the memory allocation. Perhaps that was the original problem.
No, I didn't move my project from JRuby to nodejs. I just removed therubyrhino javascript interpreter and now let the precompilation of assets depend on node.js instead
https://github.com/sstephenson/execjs#readme
I do not understand the mechanics of it all, yet, but this change was certainly a life-saver.
With no other changes (i.e. no increased memory or anything like that), my assets now precompile without failure by the JVM.
Tim
Moving from jruby to nodejs? Therubyrhino gem?
Could you please then explain your architecture? It's extremely unclear from your 2 emails.
On 1st email I can see you allocated only 500Mb to your jruby job. I would advise for 1.5Gb if you're stuck on 32 bits, 2Gb and above if you're on 64 bits.
Resolved this by installing node.js on the server, and dropping therubyrhino gem.
Asset precompilation worked nicely, with no JVM segmentation faults.
And, on y development machine, asset precompilation dropped from 2 hours to 7 minutes.
T
Ubuntu 12.04 LTS
JRuby 1.7.13
JRE 7.0_60-b19
Rails 3.2.12 application
Hi all;
Does anyone recognize this problem or can anyone suggest what I might try to figure out what's gone wrong?
$ jruby -S rake assets:precompile:all RAILS_ENV=staging RAILS_GROUPS=assets
Starts off okay...
Compiled jquery-plugins/jquery.blockUI.js (2ms) (pid 29552)
Compiled jquery-plugins/jquery.cookie.js (2ms) (pid 29552)
Compiled jquery-plugins/jquery.form.js (13ms) (pid 29552)
Compiled jquery-plugins/jquery.safeEnter.js (0ms) (pid 29552)
Compiled ckeditor/basepath.js (16ms) (pid 29552)
Compiled ckeditor/ckeditor.js (7ms) (pid 29552)
Compiled ckeditor/jquery.js (0ms) (pid 29552)
Compiled ckeditor-jquery.js (118ms) (pid 29552)
Compiled application.js (1346ms) (pid 29552)
Compiled admin.js (1389ms) (pid 29552)
#
#
# SIGSEGV (0xb) at pc=0x00007f32b205cff1, pid=29552, tid=139855679133440
#
# JRE version: Java(TM) SE Runtime Environment (7.0_60-b19) (build 1.7.0_60-b19)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (24.60-b09 mixed mode linux-amd64 compressed oops)
# V [libjvm.so+0x5c2ff1] oopDesc::size_given_klass(Klass*)+0x1
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
jvm_args: -Xmx500m -Xss2048k -Djffi.boot.library.path=/home/sshadmin/.rvm/rubies/jruby-1.7.13/lib/jni -Xbootclasspath/a:/home/sshadmin/.rvm/rubies/jruby-1.7.13/lib/jruby.jar -Djruby.home=/home/sshadmin/.rvm/rubies/jruby-1.7.13 -Djruby.lib=/home/sshadmin/.rvm/rubies/jruby-1.7.13/lib -Djruby.script=jruby -Djruby.shell=/bin/sh
java_command: org.jruby.Main -S rake assets:precompile:all RAILS_ENV=staging RAILS_GROUPS=assets
Launcher Type: SUN_STANDARD
JAVA_HOME=/usr/lib/jvm/jdk1.7.0_60
LD_LIBRARY_PATH=/usr/local/imagemagick-6.7.2/lib:/usr/local/imagemagick-6.7.2/lib:/usr/local/imagemagick-6.7.2/lib
SHELL=/bin/bash
Many thanks,
Tim
TJG
2014-07-13 19:16:22 UTC
Permalink
THanks very much for the suggestion, Alex.

I'll give that a shot and compare compile times.

Tim
Post by Alex Tambellini
Something that sped up our asset compilation process a ton was switching
gem 'closure-compiler’
config.assets.js_compressor = :closure
https://github.com/documentcloud/closure-compiler/
An excellent idea. Careful though: JDK8 is mandatory for Nashorn.
And I understood just now why therubyrhino: rails complex stack for asset
compilation. Why not sprockets instead?
Rhino is not a fast implementation of JS - whether or not it’s integrated
into JRuby via therubyrhino. Is anyone working on a therubynashorn yet?
Chris
Salut Christian;
Thanks for your observation about the memory allocation. Perhaps that was
the original problem.
No, I didn't move my project from JRuby to nodejs. I just removed
therubyrhino javascript interpreter and now let the precompilation of
assets depend on node.js instead
https://github.com/sstephenson/execjs#readme
I do not understand the mechanics of it all, yet, but this change was
certainly a life-saver.
With no other changes (i.e. no increased memory or anything like that),
my assets now precompile without failure by the JVM.
Tim
On Sun, Jul 13, 2014 at 1:25 PM, Christian MICHON <
Post by Christian MICHON
Moving from jruby to nodejs? Therubyrhino gem?
Could you please then explain your architecture? It's extremely unclear
from your 2 emails.
On 1st email I can see you allocated only 500Mb to your jruby job. I
would advise for 1.5Gb if you're stuck on 32 bits, 2Gb and above if you're
on 64 bits.
Post by TJG
Resolved this by installing *node.js* on the server, and dropping
*therubyrhino* gem.
Asset precompilation worked nicely, with no JVM segmentation faults.
And, on y development machine, asset precompilation dropped from 2
*hours* to 7 *minutes*.
T
Post by TJG
Ubuntu 12.04 LTS
JRuby 1.7.13
JRE 7.0_60-b19
Rails 3.2.12 application
Hi all;
Does anyone recognize this problem or can anyone suggest what I might
try to figure out what's gone wrong?
$ *jruby -S rake assets:precompile:all RAILS_ENV=staging
RAILS_GROUPS=assets*
Starts off okay...
Compiled jquery-plugins/jquery.blockUI.js (2ms) (pid 29552)
Compiled jquery-plugins/jquery.cookie.js (2ms) (pid 29552)
Compiled jquery-plugins/jquery.form.js (13ms) (pid 29552)
Compiled jquery-plugins/jquery.safeEnter.js (0ms) (pid 29552)
Compiled ckeditor/basepath.js (16ms) (pid 29552)
Compiled ckeditor/ckeditor.js (7ms) (pid 29552)
Compiled ckeditor/jquery.js (0ms) (pid 29552)
Compiled ckeditor-jquery.js (118ms) (pid 29552)
Compiled application.js (1346ms) (pid 29552)
Compiled admin.js (1389ms) (pid 29552)
#
#
# SIGSEGV (0xb) at pc=0x00007f32b205cff1, pid=29552,
tid=139855679133440
#
# JRE version: Java(TM) SE Runtime Environment (7.0_60-b19) (build 1.7.0_60-b19)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (24.60-b09 mixed mode
linux-amd64 compressed oops)
# V [libjvm.so+0x5c2ff1] oopDesc::size_given_klass(Klass*)+0x1
#
# Failed to write core dump. Core dumps have been disabled. To enable
core dumping, try "ulimit -c unlimited" before starting Java again
jvm_args: -Xmx500m -Xss2048k
-Djffi.boot.library.path=/home/sshadmin/.rvm/rubies/jruby-1.7.13/lib/jni
-Xbootclasspath/a:/home/sshadmin/.rvm/rubies/jruby-1.7.13/lib/jruby.jar
-Djruby.home=/home/sshadmin/.rvm/rubies/jruby-1.7.13
-Djruby.lib=/home/sshadmin/.rvm/rubies/jruby-1.7.13/lib
-Djruby.script=jruby -Djruby.shell=/bin/sh
java_command: org.jruby.Main -S rake assets:precompile:all
RAILS_ENV=staging RAILS_GROUPS=assets
Launcher Type: SUN_STANDARD
JAVA_HOME=/usr/lib/jvm/jdk1.7.0_60
/bin:/home/sshadmin/.rvm/rubies/jruby-1.7.13/bin:/home/sshadmin/.rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/imagemagick-6.7.2/bin:/usr/lib/postgresql/9.1/bin:/usr/lib/jvm/jdk1.7.0_60/bin
LD_LIBRARY_PATH=/usr/local/imagemagick-6.7.2/lib:/usr/local/imagemagick-6.7.2/lib:/usr/local/imagemagick-6.7.2/lib
SHELL=/bin/bash
Many thanks,
Tim
Loading...