[rules-users] Migrating from 4.0.7 to 5.4.0.Final

Mario Fusco mario.fusco at gmail.com
Wed Jul 4 10:18:07 EDT 2012


JP Chemali wrote
> 
> Yes in my case it would be nice for generated classes to be garbage
> collected when no longer referenced : for long-lived virtual machines
> where rules are changed a lot, you really hit the max perm gen quickly
> enough. 
> I guess what you are describing is a production environment where rules
> are loaded/compiled once in the VM's life (startup time most probably) and
> that's it. That's not my case, it's rather the reverse in some cases, as
> specialized users can test their rule sets in the same environment as the
> production one and choose to release them.
> 

Ok, now I see your point. I will try to refactor that bit to avoid that the
thread holds a reference to the classes it generates.


JP Chemali wrote
> 
> Your option to control JITing space looks like a good way to keep things
> in check. Would it possible to ensure if we set the space to 0, it
> actually disables it? That would ensure that everything runs in my calling
> threads and gets garbage collected right?
> 

Yes, of course it will be possible, even if my suggestion is to avoid this
in production otherwise you will have ALL the constraints running in
interpreted mode. Actually you could already achieve this if you can rebuild
drools from the sources (you already did it, so I assume it won't be a
problem). If you want to try open the class MvelConstraint and modify the
constant JIT_THRESOLD. That constant defines after how many times a
constraint can be evaluated in interpreted mode before to get JITted, so if
you set it to a very high value (e.g. Integer.MAX_VALUE) you should be able
to completely avoid any JITting. Let me know if this works.

I hope this helps,
Mario

--
View this message in context: http://drools.46999.n3.nabble.com/Migrating-from-4-0-7-to-5-4-0-Final-tp4018215p4018469.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list