Your application used more memory than the safety cap of 500m

bundle exec warble:

Error: Your application used more memory than the safety cap of 500m.
Specify -J-Xmx####m to increase it (#### = cap size in MB).
Specify -w for full OutOfMemoryError stack trace

Then I do:

jruby -J-Xmx1024m -S bundle exec warble

but still:

Error: Your application used more memory than the safety cap of 500m.
Specify -J-Xmx####m to increase it (#### = cap size in MB).
Specify -w for full OutOfMemoryError stack trace

My doubt is that is a very simple application it’s strange to me that
it uses such amount of memory.

On 27 May 2011 11:18, Mauro [email protected] wrote:

but still:

Error: Your application used more memory than the safety cap of 500m.
Specify -J-Xmx####m to increase it (#### = cap size in MB).
Specify -w for full OutOfMemoryError stack trace

My doubt is that is a very simple application it’s strange to me that
it uses such amount of memory.

I’m using jruby-1.6.2 and rails 3.0.7.

On 27 May 2011 11:28, Mauro [email protected] wrote:

I’m using jruby-1.6.2 and rails 3.0.7.

It seems to me that warbler encounters problems when I try to generate
the war file.
How can I investigate about it?

On 27 May 2011 19:30, Mauro [email protected] wrote:

On 27 May 2011 11:28, Mauro [email protected] wrote:

I’m using jruby-1.6.2 and rails 3.0.7.

It seems to me that warbler encounters problems when I try to generate
the war file.
How can I investigate about it?

I’m trying to debug the problem, when I run jruby -J-Xmx1024m -S
bundle exec warble with visualVM I see two processes, the first has
Xmx1024m but the second still have Xmx500m.

On 27 May 2011 21:29, Mauro [email protected] wrote:

I’m trying to debug the problem, when I run jruby -J-Xmx1024m -S
bundle exec warble with visualVM I see two processes, the first has
Xmx1024m but the second still have Xmx500m.

I’m hanging, I can’t exit from this problem.
A little help please?

On 27 May 2011 22:56, Christian MICHON [email protected]
wrote:

Have you tried setting JRUBY_OPTS=-J-Xmx1024m ?

I’m tried, now bundle exec warble says:

warble aborted!
Error: Your application used more memory than the safety cap of 1024m

I think the problem is not the heap size but there is another problem.
How can I investigate about it?

So the JRUBY_OPTS trick worked: now the sub process uses the same max
cap, and it tells you need more than 500M and more than 1G of memory.

Can you please tell the list more details? OS of the machine, RAM
available, list of gems, etc…

Most important: can your application be shared?

On 5/28/11, Mauro [email protected] wrote:

How can I investigate about it?


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


Christian

http://detaolb.sourceforge.net/, a linux distribution for Qemu with Git
inside !

On Fri, May 27, 2011 at 11:53 PM, Mauro [email protected] wrote:

I’m trying to debug the problem, when I run jruby -J-Xmx1024m -S
bundle exec warble with visualVM I see two processes, the first has
Xmx1024m but the second still have Xmx500m.

I’m hanging, I can’t exit from this problem.
A little help please?

Have you tried setting JRUBY_OPTS=-J-Xmx1024m ?


Christian

On Sat, May 28, 2011 at 8:07 PM, Mauro [email protected] wrote:

The OS is linux debian, 4G ram, the Gemfile is:

(…)

I just realized: bundle exec warble ???

jruby -> bundle -> warble

1/ that would be 3 levels, not 2…
2/ I would advise to install warble as a jruby gem and not as a rails
gem. Bundle exec may mean you actually installed warble and its
dependencies in the rails folders, and this would be quite big. This
would remove 1 level
3/ I would avise to extract from the warble gem bin/warble and run it
with jruby directly (no -S). This would remove 1 level

I use warble like this in my experiments to make redmine.war + tomcat
with jruby-complete + gems in jars in tomcat/lib.

This works fine here. I’m not using rails3 nor rails2, but ramaze
instead. Redmine + tomcat is just an experiment…

I cannot help more on your rails3 + warble + jruby issues, but try out
the techniques I’ve suggested.

Alternatively, make the war by hand instead. Get a proper rails3
web.xml from a previous successful run, and add the files in the war
(which is just a zip after all).


Christian

On 28 May 2011 20:51, Christian MICHON [email protected]
wrote:

Sorry no.
gem. Bundle exec may mean you actually installed warble and its
dependencies in the rails folders, and this would be quite big. This
would remove 1 level
3/ I would avise to extract from the warble gem bin/warble and run it
with jruby directly (no -S). This would remove 1 level

I’ve done jruby -S gem uninstall warbler that were installed via
bundle and I do jruby -S gem install warbler.
With bundle warbler gem was installed under
JRUBY_HOME/lib/ruby/gem/1.8/gem/warbler…
Now that I’ve installed via jruby -S gem the only difference is that
warble executable is under JRUBY_HOME/bin but the gem is still under
JRUBY_HOME/lib/ruby/gem/1.8/gem/warbler…
One thing I had warbler in my Gemfile because I’ve read
http://rubydoc.info/gems/warbler/1.3.1/frames that suggest to put
warbler under group :development in the Gemfile.

On 28 May 2011 16:26, Christian MICHON [email protected]
wrote:

So the JRUBY_OPTS trick worked: now the sub process uses the same max
cap, and it tells you need more than 500M and more than 1G of memory.

Can you please tell the list more details? OS of the machine, RAM
available, list of gems, etc…

Most important: can your application be shared?

Sorry no.
The OS is linux debian, 4G ram, the Gemfile is:

source ‘http://rubygems.org

gem ‘rails’
gem ‘foreigner’
gem ‘compass’
gem ‘annotate’
gem ‘normalize_attributes’
gem ‘haml-rails’
gem ‘jquery-rails’
gem ‘devise_ldap_authenticatable’
gem ‘meta_where’
gem ‘meta_search’
gem ‘simple_form’
gem ‘inherited_resources’
gem ‘inherited_resources_views’
gem ‘rails_config’
gem ‘mongrel’
#gem ‘kaminari’
gem “will_paginate”, “~> 3.0.pre2”

Bundle edge Rails instead:

gem ‘rails’, :git => ‘git://github.com/rails/rails.git’

platforms :ruby do
gem ‘sqlite3’
gem ‘pg’

Deploy with Capistrano

gem ‘capistrano’
end

platforms :jruby do
gem ‘activerecord-jdbc-adapter’

As rails --database switch does not support derby, hsqldb, h2 nor

mssql

as valid values, if you are not using SQLite, comment out the SQLite

gem

below and uncomment the gem declaration for the adapter you are

using.

If you are using oracle, db2, sybase, informix or prefer to use the

plain

JDBC adapter, comment out all the adapter gems below.

SQLite JDBC adapter

gem ‘jdbc-sqlite3’, :require => false

Postgres JDBC adapter

#gem ‘activerecord-jdbcpostgresql-adapter’
gem ‘jdbc-postgres’
gem ‘jruby-openssl’

gem ‘warbler’

end

Use unicorn as the web server

gem ‘unicorn’

Deploy with Capistrano

gem ‘capistrano’

To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby

1.9.2+)
#platforms :ruby_18 do

gem ‘ruby-debug’

gem ‘mongrel’, ‘1.1.5’

gem ‘thin’

#end

#platforms :ruby_19 do
#gem ‘ruby-debug19’, :require => ‘ruby-debug’
#gem ‘mongrel’, ‘1.2.0.pre2’
#end

Bundle the extra gems:

gem ‘bj’

gem ‘nokogiri’

gem ‘sqlite3-ruby’, :require => ‘sqlite3’

gem ‘aws-s3’, :require => ‘aws/s3’

Bundle gems for the local environment. Make sure to

put test-only gems in this group so their generators

and rake tasks are available in development mode:

group :development, :test do
gem ‘rspec-rails’
gem ‘cucumber-rails’
gem ‘capybara’
gem ‘launchy’
gem ‘autotest’
gem ‘autotest-notification’
gem ‘database_cleaner’
gem ‘spork’, ‘~> 0.9.0.rc’
gem ‘machinist’, ‘>= 2.0.0.beta1’
gem ‘faker’
end

group :development do
gem ‘hpricot’
gem ‘ruby_parser’
gem ‘warbler’
end

jruby-1.6.2, rails 3.0.7.
Do you need other infos?

On 28 May 2011 21:59, Christian MICHON [email protected]
wrote:

Most important: can your application be shared?
1/ that would be 3 levels, not 2…
JRUBY_HOME/lib/ruby/gem/1.8/gem/warbler…
http://xircles.codehaus.org/manage_email

in JRUBY_HOME/lib/ruby/gem/1.8/gem/warbler, there should be a bin
folder, with a warble script. Execute this one directly with jruby (no
more -S please)

Yes there is but…what’s the difference executing jruby warble
rather than jruby -S warble or bundle exec warble?

On Sat, May 28, 2011 at 11:27 PM, Mauro [email protected] wrote:

2/ I would advise to install warble as a jruby gem and not as a rails
Now that I’ve installed via jruby -S gem the only difference is that

in JRUBY_HOME/lib/ruby/gem/1.8/gem/warbler, there should be a bin
folder, with a warble script. Execute this one directly with jruby (no
more -S please)


Christian

On Sun, May 29, 2011 at 12:01 AM, Mauro [email protected] wrote:

With bundle warbler gem was installed under

rather than jruby -S warble or bundle exec warble?


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

you do not go through gem logic to find the binary. Just try it out,
please.

In my windows setup, what I did was exactly this: find all script from
bin folders inside gems, move them where jruby is and compress the
gems as jars.

I should publish this work on github, though this is windows only for
the time being.


Christian

On Sun, May 29, 2011 at 12:19 AM, Mauro [email protected] wrote:

modify ~/jruby/lib/ruby/gems/1.8/gems/warbler-1.3.0/bin/warble and
insert require ‘rubygems’ on top of it.


Christian

On 28 May 2011 22:04, Christian MICHON [email protected]
wrote:

available, list of gems, etc…
jruby -> bundle -> warble
bundle and I do jruby -S gem install warbler.
To unsubscribe from this list, please visit:
Yes there is but…what’s the difference executing jruby warble
you do not go through gem logic to find the binary. Just try it out, please.
I run:
jruby ~/jruby/lib/ruby/gems/1.8/gems/warbler-1.3.0/bin/warble

but

LoadError: no such file to load – warbler
require at org/jruby/RubyKernel.java:1038
(root) at
/home/user/jruby/lib/ruby/gems/1.8/gems/warbler-1.3.0/bin/warble:10

On Sun, May 29, 2011 at 12:31 AM, Mauro [email protected] wrote:

require at org/jruby/RubyKernel.java:1038
Specify -J-Xmx####m to increase it (#### = cap size in MB).
Specify -w for full OutOfMemoryError stack trace

I was expecting you to run it with JRUBY_OPTS set as indicated earlier
in this thread, at 1GB

Out of curiosity: how big is your complete rails app directory ?


Christian

On 28 May 2011 22:23, Christian MICHON [email protected]
wrote:

(root) at /home/user/jruby/lib/ruby/gems/1.8/gems/warbler-1.3.0/bin/warble:10

modify ~/jruby/lib/ruby/gems/1.8/gems/warbler-1.3.0/bin/warble and
insert require ‘rubygems’ on top of it.

Same problem:

warble aborted!
Error: Your application used more memory than the safety cap of 500m.
Specify -J-Xmx####m to increase it (#### = cap size in MB).
Specify -w for full OutOfMemoryError stack trace

On 28 May 2011 22:34, Christian MICHON [email protected]
wrote:

LoadError: no such file to load – warbler
Error: Your application used more memory than the safety cap of 500m.
Specify -J-Xmx####m to increase it (#### = cap size in MB).
Specify -w for full OutOfMemoryError stack trace

I was expecting you to run it with JRUBY_OPTS set as indicated earlier
in this thread, at 1GB

Same problem:

warble aborted!
Error: Your application used more memory than the safety cap of 1024m.
Specify -J-Xmx####m to increase it (#### = cap size in MB).
Specify -w for full OutOfMemoryError stack trace

Out of curiosity: how big is your complete rails app directory ?

It’s a small application of about 32M.
The warble works well until 2 month ago.

On Sun, May 29, 2011 at 12:47 AM, Mauro [email protected] wrote:

warble aborted!
warble aborted!
Error: Your application used more memory than the safety cap of 1024m.
Specify -J-Xmx####m to increase it (#### = cap size in MB).
Specify -w for full OutOfMemoryError stack trace

Out of curiosity: how big is your complete rails app directory ?

It’s a small application of about 32M.
The warble works well until 2 month ago.

32M should not require this much RAM from jruby/warble. As mentioned,
this is out of my league: jruby on linux + rails3.

You could try out reverting to jruby-1.6.11, 1.6.0, 1.5.x… in this
order

Could you please build a test case from scratch and post it to jruby
JIRA ?

http://jira.codehaus.org/browse/JRUBY

Good luck


Christian

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs