jruby

Very large retained heap size for org.jruby.RubyRegexp$RegexpCache in JRuby Rails App

不羁岁月 提交于 2020-01-25 18:55:54
问题 We have analysed a heap dump file for our application (running on Tomcat with jruby 1.7.8). It shows us that the retained heap size is very large (439,459,128) for the class org.jruby.RubyRegexp$RegexpCache. This is 48% of our memory usage Looking at the source code for that file it is 3 final static object created at startup (patternCache / quotedPatternCache / preprocessedPatternCache) This seems to be a pretty core part of JRuby. My question is, is it normal to have such a large percentage

Very large retained heap size for org.jruby.RubyRegexp$RegexpCache in JRuby Rails App

那年仲夏 提交于 2020-01-25 18:55:07
问题 We have analysed a heap dump file for our application (running on Tomcat with jruby 1.7.8). It shows us that the retained heap size is very large (439,459,128) for the class org.jruby.RubyRegexp$RegexpCache. This is 48% of our memory usage Looking at the source code for that file it is 3 final static object created at startup (patternCache / quotedPatternCache / preprocessedPatternCache) This seems to be a pretty core part of JRuby. My question is, is it normal to have such a large percentage

Alternative for spawning a process with 'fork' in jRuby?

喜欢而已 提交于 2020-01-24 04:36:09
问题 In MRI Ruby I can do this: def transfer internal_server = self.init_server pid = fork do internal_server.run end # Make the server process run independently. Process.detach(pid) internal_client = self.init_client # Do other stuff with connecting to internal_server... internal_client.post('some data') ensure # Kill server Process.kill('KILL', pid) if pid end However the above code will not run in jRuby, because it does not support 'fork' method: NotImplementedError: fork is not available on

How to create Windows Service using JRuby?

让人想犯罪 __ 提交于 2020-01-17 05:04:07
问题 I know we can create windows service using win32-service gem which is available in Ruby. How we can create a windows service in JRuby, is there any java-specific way which can be re-used ?? 回答1: I'm not sure if there's anything JRuby specific, but you should be able to use Java based service wrappers like 'Java Service Wrapper'. It's used by a lot of OSS projects. For more information, check the sample integration. 来源: https://stackoverflow.com/questions/4013970/how-to-create-windows-service

JRuby loadpath messed up

人走茶凉 提交于 2020-01-16 19:01:26
问题 I am embedding JRuby on a JAR file and it's being used by a EAR file that I am deploying to WebSphere. When I call the class from my workspace, it works fine, however when I call it inside WebSphere, here's what I get: [3/31/11 11:21:15:984 BRT] 00000042 SystemErr R classpath:/lib/xmlcompare.rb:4:in `require': no such file to load -- rubygems (LoadError) from classpath:/lib/xmlcompare.rb:4 from classpath:/lib/xmlcompare.rb:1:in `require' from <script>:1 After some research, I noticed that

How to get the ram footprint of a specific object in JRuby

点点圈 提交于 2020-01-16 08:51:30
问题 Is there a way to query the ram footprint of a specific object in JRuby? 回答1: Have you heard about jmap, jhat, and visualvm? jmap outputs the object memory maps / heap memory details for the given Java process. jhat is a heap analysis tool that lets you create a Java heap dump, and then lets you query it using a SQL-like language to get more detail. visualvm is yet another Java tool for viewing details about a Java applications as they are running in the JVM. I found this post from Charles

Why is Rufus scheduling the job twice?

安稳与你 提交于 2020-01-15 09:53:21
问题 Steps to replicate: Create a new Rails project. (rails 3.2.22.5) Add dependencies (warbler, rake, rufus-scheduler) (/Gemfile) JRuby 9.1.7.0 Create new files. (/config/warble.rb) (/web.xml.erb) (/config/intializers/scheduler_rufus.rb) Create an executable war file with jetty webserver. (warble war RAILS_ENV=development) Launch the executable. (java -jar mywar.war) The scheduler runs the job 2 times. /Gemfile: source 'https://rubygems.org' gem 'rails', '3.2.22.5' # Bundle edge Rails instead: #

Why is Rufus scheduling the job twice?

给你一囗甜甜゛ 提交于 2020-01-15 09:52:08
问题 Steps to replicate: Create a new Rails project. (rails 3.2.22.5) Add dependencies (warbler, rake, rufus-scheduler) (/Gemfile) JRuby 9.1.7.0 Create new files. (/config/warble.rb) (/web.xml.erb) (/config/intializers/scheduler_rufus.rb) Create an executable war file with jetty webserver. (warble war RAILS_ENV=development) Launch the executable. (java -jar mywar.war) The scheduler runs the job 2 times. /Gemfile: source 'https://rubygems.org' gem 'rails', '3.2.22.5' # Bundle edge Rails instead: #

debugger (Intellij IDEA) failing when hits breakpoint (cucumber, ruby, rspec, capybara)

旧城冷巷雨未停 提交于 2020-01-15 07:56:05
问题 While trying to debug a cucumber scenario in IntelliJ(11.1.5), it is failing with the following error when it hits the first breakpoint. It runs successfully, if I remove all the breakpoints. gem list capybara (2.0.2, 1.1.4) cucumber (1.2.3, 1.2.1) rspec (2.13.0) ruby-debug-base (0.10.3.4 java) ruby-debug-ide (0.4.17.beta9) Testing started at 1:12 PM ... Fast Debugger (ruby-debug-ide 0.4.17.beta9, ruby-debug-base 0.10.3.4) listens on 127.0.0.1:60409 Using the default profile... file:/Users

Embedding JRuby in Java code using rvm jruby install

我只是一个虾纸丫 提交于 2020-01-14 03:52:07
问题 I'm trying to embed and evaluate ruby code from within a Java application. Instead of putting jruby-complete.jar in my classpath, I need to be able to use jruby environment that's installed with rvm. I can execute basic kernel code, but I'm having issues requiring standard libraries (fileutils, tmpdir, etc.). I created the test file below that uses a JRuby installed via RVM, anyone should be able to compile+run it if you have a local rvm + jruby installation (change JRUBY_VERSION to a version