Hi Li,
jruby is run on jvm so there is no such thing as releasing classes
when You want it, garbage collector will release them when it will
want to. If You are not experiencing out of memory exception
everything is fine.
I do mean: the garbage collector could not release them. And it’s very
quickly get out of memory exception if you run the script I attached.
I also took a look at the java heap dump (a hprof file). All classes
defined at run time are in memory heap, and nothing references them,
except the super class that has a subclasses variable referencing all
subclasses. Those references are weak references, but the subclass has
a variable superClass also holds it’s super class, which I think may
cause the issue that garbage collector can not collect these subclasses.
On Jul 23, 2010, at 10:50 PM, Paweł Wielgus wrote: