[groovy-user] javaorg.codehaus.groovy.runtime.metaclass.MetaMethodIndex$Entry

76 views
Skip to first unread message

Edward Scanzano

unread,
Feb 10, 2010, 11:22:45 PM2/10/10
to us...@groovy.codehaus.org
Hi All,

I have a tool for analyzing the java heap and I noticed that the instances of
javaorg.codehaus.groovy.runtime.metaclass.MetaMethodIndex$Entry are not getting
cleared (event after as GC).

Is there a bug with this? I am using Groovy in an embedded mode where I execute
code that looks like this:

CommonScriptBase scriptBase = new CommonScriptBase(context,this);
Binding binding = new Binding();
binding.setVariable("coriolis",scriptBase);
GroovyShell shell = new GroovyShell(binding);

try {
out = shell.evaluate(getPropertyAsString("Initial Value"));

....

This leaves me with a huge number of
org.codehaus.groovy.runtime.metaclass.MetaMethodIndex$Entry instances which will
not be garbage collected.

Do I need to anything special to force this objects to clear out?

Thanks


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


Jochen Theodorou

unread,
Feb 11, 2010, 5:37:32 AM2/11/10
to us...@groovy.codehaus.org
Edward Scanzano wrote:
> Hi All,
>
> I have a tool for analyzing the java heap and I noticed that the instances of
> javaorg.codehaus.groovy.runtime.metaclass.MetaMethodIndex$Entry are not getting
> cleared (event after as GC).
>
> Is there a bug with this? I am using Groovy in an embedded mode where I execute
> code that looks like this:
>
> CommonScriptBase scriptBase = new CommonScriptBase(context,this);
> Binding binding = new Binding();
> binding.setVariable("coriolis",scriptBase);
> GroovyShell shell = new GroovyShell(binding);
>
> try {
> out = shell.evaluate(getPropertyAsString("Initial Value"));
>
> ....
>
> This leaves me with a huge number of
> org.codehaus.groovy.runtime.metaclass.MetaMethodIndex$Entry instances which will
> not be garbage collected.
>
> Do I need to anything special to force this objects to clear out?

They are referenced by the used meta classes, which are only garbage
collected on low memory since weak references are used for them. So
instead of running the GC you should fill the memory and see if it is
collected on low memory.

bye blackdrag

--
Jochen "blackdrag" Theodorou
The Groovy Project Tech Lead (http://groovy.codehaus.org)
http://blackdragsview.blogspot.com/

Reply all
Reply to author
Forward
0 new messages