# Rjb heap size OR call ruby methods from java

**URL:** <https://www.ruby-forum.com/t/rjb-heap-size-or-call-ruby-methods-from-java/141701>\
**Category:** Ruby\
**Created:** [June 29, 2008, 7:00pm UTC](https://www.ruby-forum.com/t/rjb-heap-size-or-call-ruby-methods-from-java/141701 "2008-06-29T19:00:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![shashank\_hi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7bcc69/32.png) [@shashank\_hi](https://www.ruby-forum.com/u/shashank_hi)\
**Post date:** [June 29, 2008, 7:00pm UTC](https://www.ruby-forum.com/t/rjb-heap-size-or-call-ruby-methods-from-java/141701/1 "2008-06-29T19:00:48Z")

</div>

I’ve been using rjb (ruby java bridge) to use a method from a Java  
library. Problem is, that I run out of heap while running that method.  
I’m on a Windows machine, and I increased the max heap size for Java  
from the Control Panel, but the problem continued. Is there a way to fix  
that?

If not, is it possible to call Ruby methods from Java, something like  
Inline? Xruby might help, but I wonder if it could help (never used it,  
and the currently reported problems put me off).

---

<div class="post-metadata">

**Author:** ![shashank\_hi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7bcc69/32.png) [@shashank\_hi](https://www.ruby-forum.com/u/shashank_hi)\
**Post date:** [June 29, 2008, 8:17pm UTC](https://www.ruby-forum.com/t/rjb-heap-size-or-call-ruby-methods-from-java/141701/2 "2008-06-29T20:17:41Z")

</div>

-------- Original-Nachricht --------

> Datum: Mon, 30 Jun 2008 01:58:13 +0900  
> Von: Shashank A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> An: removed\_email\_address@domain.invalid  
> Betreff: rjb heap size OR call ruby methods from java

> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).  
> There is also jruby … a Java implementation of the entire (or almost)  
> Ruby language – with this information on Java integration:

[http://jruby.codehaus.org/Java+Integration](http://jruby.codehaus.org/Java+Integration)

Best regards,

Axel

---

<div class="post-metadata">

**Author:** ![shashank\_hi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7bcc69/32.png) [@shashank\_hi](https://www.ruby-forum.com/u/shashank_hi)\
**Post date:** [June 30, 2008, 4:58pm UTC](https://www.ruby-forum.com/t/rjb-heap-size-or-call-ruby-methods-from-java/141701/3 "2008-06-30T16:58:36Z")

</div>

-----BEGIN PGP SIGNED MESSAGE-----  
Hash: SHA1

I believe that when you load the jvm, you can pass along the max heap  
size as a parameter:

Rjb::load(classpath = ‘.’, jvmargs=[])

I haven’t used it myself but they should be similar to the command line  
arguments:

- -Xms32m -Xmx128m

(these are the defaults which you should increase)

Tiago M.

Shashank A. wrote:  
| I’ve been using rjb (ruby java bridge) to use a method from a Java  
| library. Problem is, that I run out of heap while running that method.  
| I’m on a Windows machine, and I increased the max heap size for Java  
| from the Control Panel, but the problem continued. Is there a way to fix  
| that?  
|  
| If not, is it possible to call Ruby methods from Java, something like  
| Inline? Xruby might help, but I wonder if it could help (never used it,  
| and the currently reported problems put me off).  
-----BEGIN PGP SIGNATURE-----  
Version: GnuPG v2.0.9 (GNU/Linux)  
Comment: Using GnuPG with Mozilla - [http://enigmail.mozdev.org](http://enigmail.mozdev.org)

iEYEARECAAYFAkho9BMACgkQxFuRTtCTMvIvcwCfUiWhnnPfs97+6U5z+I8C7Zee  
7ioAoIMgkyNBIPg84eoi4NuEvUYQ3Ahx  
=jxuX  
-----END PGP SIGNATURE-----
