Issue Type: Bug Bug
Affects Versions: JRuby 1.6.5
Assignee: Thomas E Enebo
Attachments: bad.rb, MyClass.java
Created: 25/Jun/12 7:46 AM
Description:

Running jruby inside of a jetty server using the dropwizard framework. When I run a ruby script that creates a new java object and assigns a field of type Map<String, Object> with a value of new array. Each time this scripts runs org.jruby.gen.InterfaceImpl708991507 is loaded and never unloaded. This will slowly eat up permGen until it runs out.

Here is an example

ruby

require 'java'
import 'me.irieksts.playground.jruby.permgen.MyClass';

def test()
myList = Array.new
myClass = MyClass.new
myClass.setName('name')
myClass.setMyMap([])
myList << myClass
return myList
end

java class

package me.irieksts.playground.jruby.permgen;

import java.util.Map;

public class MyClass {
private String name;
private Map<String, Object> myMap;

public String getName() { return name; }

public void setName(String name) { this.name = name; }

public Map<String, Object> getMyMap() { return myMap; }

public void setMyMap(Map<String, Object> myMap) { this.myMap = myMap; }
}

Calling code

public Object runScript(String script) throws IOException { ScriptingContainer rubyContainer = new ScriptingContainer(LocalContextScope.CONCURRENT); //also happens if this is a field and not a local variable. EmbedEvalUnit embedEvalUnit = rubyContainer.parse(script); return rubyContainer.callMethod(embedEvalUnit.run(), "test"); }

Environment: Linux, Jetty, Shade, Dropwizard
Project: JRuby
Priority: Major Major
Reporter: Isaac Rieksts
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email

Reply via email to