| Message: 173261 |
 |
BY: Alex Porras (cafebueno) DATE: 2013-01-07 23:43 SUBJECT: unloading the jvm throws errors I am using RJB to run some java code from a third party jar. The code runs as expected. However, there seems to be a memory leak somewhere between the java code and the local ruby code.
Long term, I may go as far as profiling the Java code in segregation to see if the cause is there.
Short term, I was wondering if it was possible to unload the JVM on demand? I tried invoking Rjb::unload after running the code in the jar file I needed, but it throws errors, usually along the lines of not being able to call "close()" on certain objects, which varied randomly on each execution.
On occasions where Rjb::unload did work, subsequent Rjb::load calls would fail with "can't create Java VM" errors.
Any help would be appreciated.
Thanks!
--
version info:
mac os x mountain lion, 10.8.2
java version "1.6.0_37"
Java(TM) SE Runtime Environment (build 1.6.0_37-b06-434-11M3909)
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin12.2.0] | |