Hi Edgardo. <br><br>Well it shouldn&#39;t leak like that. <br><br>Looking at your code, I am not sure how it works (as I am not sure of the Web Service component you are using).<br><br>But if the web service is creating a new instance of the ValidaLlamadaWS class for EACH call, then yes that woudl be the problem. What you want to do is have the code for the agend called only once, on startup, and then use that single instance of the agent to get a rulebase for each call. 
<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;">
Hi list,<br><br>&nbsp;&nbsp;&nbsp;&nbsp; I have developed a web service for deploy my rule package, this rule<br>package is in the BRMS, the source code of the web service class is:<br><br>public class ValidaLlamadaWS {<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RuleAgent agent = 
RuleAgent.newRuleAgent(&quot;/brmsdeployedrules.properties&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RuleBase ruleBase = agent.getRuleBase();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;StatelessSession session = ruleBase.newStatelessSession();<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public Object[] ValidaLlamada(Integer cantsegundos){
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Validaciones validaciones = new Validaciones();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;validaciones.setCantsegundos(cantsegundos);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;session.execute(validaciones);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return validaciones.getResult
();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>}<br><br>The BRMS run over JBoss AS <a href="http://4.2.1.GA">4.2.1.GA</a> and the web service over Apache Tomcat<br>5.5 on the same machine, the rule base contain only 2 rules<br><br>The problem is that I need to call the web service more than 
400.000<br>times, and with 1000 times, I obtain the Java Heap Exception.<br>If I monitoring my machine memory, this only increase between calls. And<br>the process that more memory expensive is java.exe (JBoss AS <a href="http://4.2.1.GA">
4.2.1.GA</a>).<br>The process javaw.exe (Apache Tomcat 5.5)also is expensive, but less than<br>java.exe<br><br>The question are:<br><br>How I can &quot;dispose&quot; the objects that I use?<br>Is correct this use for StatelessSession?
<br>You are the experts, any other idea for implement my web service?<br><br>PD: sorry for my bad english.<br><br>Greetings<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>