0 Replies Latest reply on Oct 15, 2017 4:50 AM by Rajiv Shivane

    Reducing Rule Helper instances

    Rajiv Shivane Newbie

      Hello Andrew and team:


      We are observing that one instance of our custom Rule Helper is created for every execution of the Rule. To reduce the GC burden, it would be nice if the Rule Helper instances could be reused. In our use case, most of our Rule Helpers could be singleton ... ie only one instance per Rule. We are not using any Bindings in our rules. 


      Would it be possible to implement some sort of reuse of the Helpers? 1. We could mark them as SINGLETON in the rule file, in which case byteman could call MyHelper.getInstance(Rule).helperMethod(<params>) or 2. We could mark the Helper in the rule file as STATIC, in which case byteman could look for static helper methods instead of instance methods.

      Along with the custom Helper, the InterpretedHelper instances should be reused. Since InterpretedHelper uses a bindingMap field, it appears that using static helper methods would mean that the Rules cannot have Bindings.