Hi Edgardo. Good to hear. Yeah it was probably creating a new daemon thread for each instance in that case, which would top out on 1000 to 3000 items on most systems today, so that is not surprising ;)<br><br>Good luck !<br>
<br><br>Michael.<br><br><div><span class="gmail_quote">On 9/4/07, <b class="gmail_sendername">Edgardo</b> &lt;<a href="mailto:edgardoibanez@gmail.com">edgardoibanez@gmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thanks Michael, the problem was that every call to the web service create<br>a new instance of ValidaLlamadaWS, because the system memory explode!. I<br>fix it managing the session scope of the Web Service, now my drools + web
<br>service implementation works fine!<br><br>Thanks for you reply<br><br>Greetings, I see you in another post<br><br>En Tue, 04 Sep 2007 01:44:47 -0400, Michael Neale<br>&lt;<a href="mailto:michael.neale@gmail.com">michael.neale@gmail.com
</a>&gt; escribió:<br><br>&gt; If it still happens - it would be good if you could attach some code to<br>&gt; reproduce it to a JIRA.<br>&gt;<br>&gt; On 9/4/07, Michael Neale &lt;<a href="mailto:michael.neale@gmail.com">
michael.neale@gmail.com</a>&gt; wrote:<br>&gt;&gt;<br>&gt;&gt; Hi Edgardo.<br>&gt;&gt;<br>&gt;&gt; Well it shouldn&#39;t leak like that.<br>&gt;&gt;<br>&gt;&gt; Looking at your code, I am not sure how it works (as I am not sure of
<br>&gt;&gt; the<br>&gt;&gt; Web Service component you are using).<br>&gt;&gt;<br>&gt;&gt; But if the web service is creating a new instance of the ValidaLlamadaWS<br>&gt;&gt; class for EACH call, then yes that woudl be the problem. What you want
<br>&gt;&gt; to do<br>&gt;&gt; is have the code for the agend called only once, on startup, and then<br>&gt;&gt; use<br>&gt;&gt; that single instance of the agent to get a rulebase for each call.<br>&gt;&gt;<br>&gt;&gt;<br>
&gt;&gt; Michael.<br>&gt;&gt;<br>&gt;&gt; On 9/4/07, Edgardo &lt;<a href="mailto:edgardoibanez@gmail.com">edgardoibanez@gmail.com</a>&gt; wrote:<br>&gt;&gt; &gt;<br>&gt;&gt; &gt; Hi list,<br>&gt;&gt; &gt;<br>&gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;I have developed a web service for deploy my rule package, this
<br>&gt;&gt; &gt; rule<br>&gt;&gt; &gt; package is in the BRMS, the source code of the web service class is:<br>&gt;&gt; &gt;<br>&gt;&gt; &gt; public class ValidaLlamadaWS {<br>&gt;&gt; &gt;<br>&gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RuleAgent agent = 
RuleAgent.newRuleAgent<br>&gt;&gt; &gt; (&quot;/brmsdeployedrules.properties&quot;);<br>&gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RuleBase ruleBase = agent.getRuleBase();<br>&gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; StatelessSession session = ruleBase.newStatelessSession
();<br>&gt;&gt; &gt;<br>&gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public Object[] ValidaLlamada(Integer cantsegundos){<br>&gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Validaciones validaciones = new Validaciones();<br>&gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; validaciones.setCantsegundos
(cantsegundos);<br>&gt;&gt; &gt;<br>&gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; session.execute(validaciones);<br>&gt;&gt; &gt;<br>&gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return validaciones.getResult ();<br>&gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&gt;&gt; &gt; }
<br>&gt;&gt; &gt;<br>&gt;&gt; &gt; The BRMS run over JBoss AS <a href="http://4.2.1.GA">4.2.1.GA</a> and the web service over Apache<br>&gt;&gt; &gt; Tomcat<br>&gt;&gt; &gt; 5.5 on the same machine, the rule base contain only 2 rules
<br>&gt;&gt; &gt;<br>&gt;&gt; &gt; The problem is that I need to call the web service more than 400.000<br>&gt;&gt; &gt; times, and with 1000 times, I obtain the Java Heap Exception.<br>&gt;&gt; &gt; If I monitoring my machine memory, this only increase between calls.
<br>&gt;&gt; And<br>&gt;&gt; &gt; the process that more memory expensive is java.exe (JBoss AS<br>&gt;&gt; <a href="http://4.2.1.GA">4.2.1.GA</a>).<br>&gt;&gt; &gt; The process javaw.exe (Apache Tomcat 5.5)also is expensive, but less
<br>&gt;&gt; &gt; than<br>&gt;&gt; &gt; java.exe<br>&gt;&gt; &gt;<br>&gt;&gt; &gt; The question are:<br>&gt;&gt; &gt;<br>&gt;&gt; &gt; How I can &quot;dispose&quot; the objects that I use?<br>&gt;&gt; &gt; Is correct this use for StatelessSession?
<br>&gt;&gt; &gt; You are the experts, any other idea for implement my web service?<br>&gt;&gt; &gt;<br>&gt;&gt; &gt; PD: sorry for my bad english.<br>&gt;&gt; &gt;<br>&gt;&gt; &gt; Greetings<br>&gt;&gt; &gt;<br>&gt;&gt; &gt;
<br>&gt;&gt; &gt;<br>&gt;&gt; &gt; --<br>&gt;&gt; &gt; Edgardo Ibañez O.<br>&gt;&gt; &gt; _______________________________________________<br>&gt;&gt; &gt; rules-users mailing list<br>&gt;&gt; &gt; <a href="mailto:rules-users@lists.jboss.org">
rules-users@lists.jboss.org</a><br>&gt;&gt; &gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>&gt;&gt; &gt;<br>&gt;&gt;<br>&gt;&gt;<br><br><br>
<br>--<br>Edgardo Ibañez O.<br>_______________________________________________<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-users">
https://lists.jboss.org/mailman/listinfo/rules-users</a><br></blockquote></div><br>