hi again,

On 30 Mar 2010, at 18:32, Edson Tirelli <ed.tirelli@gmail.com> wrote:
   I am not sure I understand what you are doing when you say:

> Every X seconds I collect the available facts and call fireAllRules() + dispose(), **always within the same session**.
(emphasis is mine)
i meant that i keep using the same object, i just create one stateful session throughout the program execution.

   Compilation indeed uses more memory, but you can compile once and reuse the kbase.

exactly, i'm doing that, but it's a +700 rule file and its taking too much memory. Is there anything i can do to push it down a little bit? i wouldn't mind slowing it down to reduce memory footprint.

Also, if you are calling dispose, I guess you are running stateful sessions. Maybe you can give us a more detailed description of your session/data/application lifecycle?

Sure, i'll try. So i have this thread which initializes by reading the rule base from a drl file. It then creates a stateful session from it and enters a lifecycle in which it goes to sleep and only when some other thread wakes it up, it collects and inserts some facts (usually 2,3 or 4..) into the session and fire all rules. It's basically this. What i'm very concerned about is the amount of RAM memory the whole program is consuming. I must find a way to reduce some of it, because the rule file is being prepared by an external program and i have no control over the number of rules i might get. If i test it with a little over 700 rules, it reaches +300Mb which is a lot.

Maybe the rules are too complex? Shall i try to make them simpler (how)? what are the big memory hogs when it comes to loading a DRL file to the knowledge base? From what i've been testing, it doesn't even matter which rules you will actually need, it just loads the entire DRL file with no respect to the future activations, am i right? Is there any other aspect i should take in mind or maybe other approach?

_ miguel