[rules-users] Web Service deploy out of memory

Michael Neale michael.neale at gmail.com
Tue Sep 4 01:44:47 EDT 2007


If it still happens - it would be good if you could attach some code to
reproduce it to a JIRA.

On 9/4/07, Michael Neale <michael.neale at gmail.com> wrote:
>
> Hi Edgardo.
>
> Well it shouldn't leak like that.
>
> Looking at your code, I am not sure how it works (as I am not sure of the
> Web Service component you are using).
>
> 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.
>
>
> Michael.
>
> On 9/4/07, Edgardo <edgardoibanez at gmail.com> wrote:
> >
> > Hi list,
> >
> >      I have developed a web service for deploy my rule package, this
> > rule
> > package is in the BRMS, the source code of the web service class is:
> >
> > public class ValidaLlamadaWS {
> >
> >         RuleAgent agent = RuleAgent.newRuleAgent
> > ("/brmsdeployedrules.properties");
> >         RuleBase ruleBase = agent.getRuleBase();
> >         StatelessSession session = ruleBase.newStatelessSession();
> >
> >         public Object[] ValidaLlamada(Integer cantsegundos){
> >                 Validaciones validaciones = new Validaciones();
> >                 validaciones.setCantsegundos(cantsegundos);
> >
> >                 session.execute(validaciones);
> >
> >                 return validaciones.getResult ();
> >         }
> > }
> >
> > The BRMS run over JBoss AS 4.2.1.GA and the web service over Apache
> > Tomcat
> > 5.5 on the same machine, the rule base contain only 2 rules
> >
> > The problem is that I need to call the web service more than 400.000
> > times, and with 1000 times, I obtain the Java Heap Exception.
> > If I monitoring my machine memory, this only increase between calls. And
> > the process that more memory expensive is java.exe (JBoss AS 4.2.1.GA).
> > The process javaw.exe (Apache Tomcat 5.5)also is expensive, but less
> > than
> > java.exe
> >
> > The question are:
> >
> > How I can "dispose" the objects that I use?
> > Is correct this use for StatelessSession?
> > You are the experts, any other idea for implement my web service?
> >
> > PD: sorry for my bad english.
> >
> > Greetings
> >
> >
> >
> > --
> > Edgardo Ibañez O.
> > _______________________________________________
> > rules-users mailing list
> > rules-users at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070904/84908d02/attachment.html 


More information about the rules-users mailing list