some thoughts on ClassValue

Jochen Theodorou blackdrag at
Fri Apr 26 00:59:06 PDT 2013

Hi all,

basically ClassValue is there so that my runtime/framework or whatever 
can store information and bind it to a class. The information is then 
available as long as the class exists. In Groovy3 I am going to use this 
for meta classes.

Some time ago a user came up with a special need, he wanted to be able 
to replace the groovy runtime at runtime but could not do so because of 
classes being referenced that keep classloaders alive, which then lock 
the jar on the file system on windows.

This did let me to the thought, that as soon as I start storing meta 
classes using ClassValue, my Groovy runtime will never unload again as 
soon as I store for the example a meta class on ArrayList (which is 
likely to happen) or Object, or any other java core class for that 
matter. This makes me think that I should not directly use ClassValue to 
enable unloading... but I also do not want unloading to happen when I 
still need the value.

Does anyone have any idea on now to solve this problem?

bye blackdrag

Jochen "blackdrag" Theodorou - Groovy Project Tech Lead
german groovy discussion newsgroup: de.comp.lang.misc
For Groovy programming sources visit

More information about the mlvm-dev mailing list