[GitHub] [groovy] blackdrag commented on issue #968: Fixed the Reference of the metaclass in ClassInfo.java to use a Weak…

2019-07-29 Thread GitBox
blackdrag commented on issue #968:  Fixed the Reference of the metaclass in 
ClassInfo.java to use a Weak…
URL: https://github.com/apache/groovy/pull/968#issuecomment-516226121
 
 
   But the metaclass has hard references on the class it is a metaclass for I 
thought. Therefore it should be impossible to unload the classes without also 
or first unloading the meta classes. 
   
   The usual approach is to actually create a cache for compiled scripts and 
avoid the creation of the classes again and again. From what I understood in 
your case it can happen that you have, over a session, just two many different 
rules as scripts, so that this is not possible.. Which would mean you have ten 
thousands of them... Is that right?


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [groovy] blackdrag commented on issue #968: Fixed the Reference of the metaclass in ClassInfo.java to use a Weak…

2019-07-16 Thread GitBox
blackdrag commented on issue #968:  Fixed the Reference of the metaclass in 
ClassInfo.java to use a Weak…
URL: https://github.com/apache/groovy/pull/968#issuecomment-511848762
 
 
   From my POV  this is no solution. We are using soft references, because in 
the past a weak reference gave the class free too fast leading to the runtime 
constantly recreating the meta class and thus to horrible performance. Also 
just using a SoftReference is not supposed to prevent the class to be unloaded. 
There are JVM configurations that behave like this though.  
   Of course @NecOnIce is fully right when he says that the current 
configuration leads the JVM to use up all memory before anything is freed.
   Better would be a system in which we count how often we create the meta 
class and then maybe go with the strategy of creating first a weak reference 
and after a threshold has been reached to change it to a soft reference... just 
as an idea


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services