JRuby's JIT will eventually blow permgen space; use other mechanisms to allow
old methods to be garbage-collected
-----------------------------------------------------------------------------------------------------------------
Key: JRUBY-900
URL: http://jira.codehaus.org/browse/JRUBY-900
Project: JRuby
Issue Type: Bug
Components: Compiler
Affects Versions: JRuby 0.9.9
Reporter: Charles Oliver Nutter
Assignee: Charles Oliver Nutter
Attachments: classloader_per_jitted_method.patch
JRuby's JIT create a lot of new classes, which in certain scenarios could
result in permgen space being gobbled up until it's all gone. This is because
individual classes can't be collected in Java unless the classloader they're
associated with gets collected.
The attached patch modifies the JIT and the class-generation code in JRuby to
use a specified classloader. In the case of JITted code, this would be a new
classloader per method compiled, allowing those methods to be collected.
With it, the following code runs indefinitely without ever using up permgen:
{noformat}
while true
def hello; end
hello
end
{noformat}
The patch could use some more eyes, but it seems to work well enough. Of
course, the memory overhead caused by classloader-per-method is a whole other
issue.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
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