Re: [rules-users] java.lang.OutOfMemoryError: Java heap space

2012-10-15 Thread lhorton
Sorry, there was a JIRA link in the message thread that I didn't notice. 
https://issues.jboss.org/browse/JBRULES-1325 says the leak was fixed in 5.0



--
View this message in context: 
http://drools.46999.n3.nabble.com/java-lang-OutOfMemoryError-Java-heap-space-tp54778p4020292.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] java.lang.OutOfMemoryError: Java heap space

2012-10-14 Thread Mark Proctor
Do you have a JIRA to reference for this? Without that it's hard to check.

Mark
On 12 Oct 2012, at 23:24, lhorton lhor...@abclegal.com wrote:

 Has this issue been fixed, or is it still necessary to remove any event
 listeners so that the session is freed?
 
 
 
 --
 View this message in context: 
 http://drools.46999.n3.nabble.com/java-lang-OutOfMemoryError-Java-heap-space-tp54778p4020267.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] java.lang.OutOfMemoryError: Java heap space

2012-10-12 Thread Wolfgang Laun
Hi,

a nice problem... see below

On 12/10/2012, mohan mohan.narang...@gmail.com wrote:
 Hi laune,
 I'll explain the process briefly. I’m getting voice call events from our
 billing system. We want give some offers if call made inside specific cell
 (uploaded this fact to WM in advance) . But we have to give offer only once
 per day. So repeated calls inside this cell won’t eligible for offer again.
 To achieve this we initiate a new event(NotificationEvent) and insert into
 WM and set metadata @expires(24h) against each mobile no. Ultimately over
 1000K NotificationEvents are residing in WM per day and guess it will
 trigger OutOfMemory exception.  How to handle such a case? Do we need to use
 caching mechanism?


Unclear: Is NotificationEvent in the preceding paragraph the
OfferedEvent in your rule below? And the expiry would have to be set
for OfferedEvent, not each mobile no (as written above).

Also, clarify once per day. It seems that you want not again in the
next 24 hours but it can also be interpreted as only once between
0:00 and 24:00. (The latter would be much easier to handle.)

Beware: nothing of the code below is tested.

Reducing the number of facts can be done by registering offers made in a
one fact per offerId (assuming a mobile number can be stored in a long,
which should be possible):

declare OffersMade
  offerId : int
  origin2time : MapLong,Long
end

You match a call event to an offer:

rule Call matches Offer
when
$vc : VoiceCallEvent( $ct : eventTime,
  $cell : cellID,
  $mobile : originNumber)
$offer : CymOfferInfo($valTo : validTo.time = $ct,
  cellId == $cell,
  $offerId : offerType.getId,
  $msgContent : cepMsgTemplates.getId)
then
end

Then there's two cases: you don't have a matching OffersMade yet, or
you have but the caller isn't registered:

rule No such offer yet
extends Call matches Offer
when
not OffersMade( offerId == $offerId )
then
OffersMade offersMade = new OffersMade();
offersMade.setOfferId( $offerId );
Map o2t = new HashMap();
offersMade.setOrigin2Time( o2t );
o2t.put( $mobile, $ct.getTime() );
insert( offersMade );
MdbServiceUtil.sendSMS( $mobile, $msgContent );
retract( $vc );
end

rule No offer for this origin
extends Call matches Offer
when
$om: OffersMade( offerId == $offerId,
 origin2time.keySet not contains $mobile )
then
$om.getOrigin2Time().put( $mobile, $ct.getTime() );
update( $om );
MdbServiceUtil.sendSMS( $mobile, $msgContent );
retract( $vc );
end

Finally you need to get rid of old entries. This can be done in a rule
with a timer:

rule erase old offers
timer (cron:* 0/15 * * * ?)
when
$om: OffersMade()
then
boolean change = false;
long limit = (new Date()).getTime() - 24*60*60*1000;
for( Map.Entry entry: $om.getOrigin2Time().entrySet() ){
if( (Long)entry.getValue() = limit ){
   $om.getOrigin2Time().remove( entry.getKey() );
   change = true;
}
}
if( change ) update( $om );
end

This still requires two Long objects per offer made (and overhead for the Map).

You might reduce this further by storing the time only once per
OffersMade, so that it is sufficient to have a Set for the
originNumbers:

declare OffersMade
  offerId : int
  offerTime : long
  origins : SetLong
end

Of course it would be obtuse to have one OffersMade per millisecond,
which means that offerTime must be reduced to ticks of some reasonable
granularity, I'd say between 1m and 1h. The required rule set is
similar to the preceding one, even simpler, as it is, for instance,
possible to discard an OffersMade object entirely after 24 hours:

rule discard old set
timer( int: 24h )
when
$om: OffersMade
then
retract( $om );
end

-W



 Thanks.

 see below code snippet

 rule Voice CYM offer selector
 dialect java
 no-loop true
 when
 $vc : VoiceCallEvent( $ct : eventTime, $cell : cellID, $mobile :
 originNumber) from entry-point IN-VOICE-CALL-EVENT
 $offer : CymOfferInfo($valTo : validTo.time = $ct, cellId ==
 $cell,$offerId : offerType.getId, $msgContent : cepMsgTemplates.getId)
 not( OfferedEvent(mobileNo == $mobile , offerId ==  $offerId ))
 then
CYMOfferMessage genMsg = new CYMOfferMessage();
OfferedEvent offered = new OfferedEvent();
offered.setMobileNo($mobile);
offered.setOfferId((String)$offerId);
genMsg.setMobile($mobile);
genMsg.setMsgContent($msgContent);

 /* atttach offer here */

 /*  drop SMS message to queue  block offer trigger again*/
 mdbService.dropMessage(genMsg);
 insert(offered);
 end



 --
 View this message in context:
 http://drools.46999.n3.nabble.com/java-lang-OutOfMemoryError-Java-heap-space-tp4020185p4020235.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.

 

Re: [rules-users] java.lang.OutOfMemoryError: Java heap space

2012-10-12 Thread mohan
Hi laune, 

really appreciate your valuable time  dedication on this.
Yes I did a mistake that there is no NotificationEvent and that should be
OfferedEvent.
Primary keys of the OfferedEvent  are mobileNo  offerId. i.e should not
send particular offer notification to perticuler mobile within next 24 hour.
once per day : not again in the next 24 hours” . (not calender days)

I’m checking your code and will try to apply. If there are any suggestion or
any amendments based on above input please post.

Thanks a lot



--
View this message in context: 
http://drools.46999.n3.nabble.com/java-lang-OutOfMemoryError-Java-heap-space-tp4020185p4020246.html
Sent from the Drools: User forum mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] java.lang.OutOfMemoryError: Java heap space

2012-10-12 Thread lhorton
Has this issue been fixed, or is it still necessary to remove any event
listeners so that the session is freed?



--
View this message in context: 
http://drools.46999.n3.nabble.com/java-lang-OutOfMemoryError-Java-heap-space-tp54778p4020267.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] java.lang.OutOfMemoryError: Java heap space

2012-10-11 Thread Wolfgang Laun
On 11/10/2012, mohan mohan.narang...@gmail.com wrote:
 Hi laune,

 Assume we continuously getting vast number of facts or events from a stream
 and we want to reasoning over particular time window (accumulate number of
 events on this window) how we could achieve the same? Guess we cannot call
 dispose() after fireAllRules().

Certainly not - you'd lose all facts.

If you need to keep some facts but have to avoid keeping them all
you'll have to devise some method that retracts facts whenever they
aren't useful any more.

Automatic retraction of events might be one way - see the Fusion
manual. OTOH, you might want to implement an explicit strategy for
deleting obsolete facts.

-W




 --
 View this message in context:
 http://drools.46999.n3.nabble.com/java-lang-OutOfMemoryError-Java-heap-space-tp4020185p4020206.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] java.lang.OutOfMemoryError: Java heap space

2012-10-11 Thread mohan
Hi laune,
Yes i already used @expires(24h) metadata for event. So each event will
expire after 24 hours. But per day we are getting over 1000k events and
inserting it into working memory will cause to java.lang.OutOfMemoryError.
Guess increase Java heap size not best solution either. How we can tackle
this situation?

thanks a lot your great ideas..



--
View this message in context: 
http://drools.46999.n3.nabble.com/java-lang-OutOfMemoryError-Java-heap-space-tp4020185p4020225.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] java.lang.OutOfMemoryError: Java heap space

2012-10-11 Thread mohan
Hi laune,
I'll explain the process briefly. I’m getting voice call events from our
billing system. We want give some offers if call made inside specific cell
(uploaded this fact to WM in advance) . But we have to give offer only once
per day. So repeated calls inside this cell won’t eligible for offer again.
To achieve this we initiate a new event(NotificationEvent) and insert into
WM and set metadata @expires(24h) against each mobile no. Ultimately over
1000K NotificationEvents are residing in WM per day and guess it will
trigger OutOfMemory exception.  How to handle such a case? Do we need to use
caching mechanism?

Thanks.

see below code snippet

rule Voice CYM offer selector
dialect java
no-loop true
when
$vc : VoiceCallEvent( $ct : eventTime, $cell : cellID, $mobile :
originNumber) from entry-point IN-VOICE-CALL-EVENT
$offer : CymOfferInfo($valTo : validTo.time = $ct, cellId ==
$cell,$offerId : offerType.getId, $msgContent : cepMsgTemplates.getId)
not( OfferedEvent(mobileNo == $mobile , offerId ==  $offerId ))
then
   CYMOfferMessage genMsg = new CYMOfferMessage();
   OfferedEvent offered = new OfferedEvent();
   offered.setMobileNo($mobile);
   offered.setOfferId((String)$offerId);
   genMsg.setMobile($mobile);
   genMsg.setMsgContent($msgContent);

/* atttach offer here */
  
/*  drop SMS message to queue  block offer trigger again*/
mdbService.dropMessage(genMsg);
insert(offered);  
end



--
View this message in context: 
http://drools.46999.n3.nabble.com/java-lang-OutOfMemoryError-Java-heap-space-tp4020185p4020235.html
Sent from the Drools: User forum mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] java.lang.OutOfMemoryError: Java heap space

2012-10-10 Thread Wolfgang Laun
Just repeat this, as often as required, with as many facts in facts
as you want:

// copy-pasted from the API documentation ;-)
StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
 for( Object fact : facts ) {
 ksession.insert( fact );
 }
 ksession.fireAllRules();
 ksession.dispose();

-W


On 09/10/2012, Brenda1636 brenda.chodkow...@ctg.com wrote:
 I've seen many posts about users receiving a java.lang.OutOfMemoryError:
 Java heap space error. The answer have been to increase heap space. I was
 wondering if there is another way around this.

 I have about 10,000 facts that I want to bring into working memory. Is
 there
 a way to insert some of them, run the rules, remove the inserted ones, and
 then insert more?

 Thanks!



 --
 View this message in context:
 http://drools.46999.n3.nabble.com/java-lang-OutOfMemoryError-Java-heap-space-tp4020185.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] java.lang.OutOfMemoryError: Java heap space

2012-10-10 Thread Mahadevappa, Shobha
Is there anything that has to be taken care in case of a stateless session.
I have a huge collection of facts that needs to get into the working memory and 
I fire ksession.execute(Collecton object);



Regards,
Shobha M | Senior Program Manager, AAD | NTT DATA Global Delivery Services 
Limited| w. +91-80-26659482 (Ext 3679) | v. 8814.3679 | m. +91.9972522743 | 
shobha.mahadeva...@nttdata.com


-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Wolfgang Laun
Sent: 10 October 2012 PM 12:58
To: Rules Users List
Subject: Re: [rules-users] java.lang.OutOfMemoryError: Java heap space

Just repeat this, as often as required, with as many facts in facts
as you want:

// copy-pasted from the API documentation ;-) StatefulKnowledgeSession ksession 
= kbase.newStatefulKnowledgeSession();
 for( Object fact : facts ) {
 ksession.insert( fact );
 }
 ksession.fireAllRules();
 ksession.dispose();

-W


On 09/10/2012, Brenda1636 brenda.chodkow...@ctg.com wrote:
 I've seen many posts about users receiving a java.lang.OutOfMemoryError:
 Java heap space error. The answer have been to increase heap space. I 
 was wondering if there is another way around this.

 I have about 10,000 facts that I want to bring into working memory. Is 
 there a way to insert some of them, run the rules, remove the inserted 
 ones, and then insert more?

 Thanks!



 --
 View this message in context:
 http://drools.46999.n3.nabble.com/java-lang-OutOfMemoryError-Java-heap
 -space-tp4020185.html Sent from the Drools: User forum mailing list 
 archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

__
Disclaimer:This email and any attachments are sent in strictest confidence for 
the sole use of the addressee and may contain legally privileged, confidential, 
and proprietary data.  If you are not the intended recipient, please advise the 
sender by replying promptly to this email and then delete and destroy this 
email and any attachments without any further use, copying or forwarding

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] java.lang.OutOfMemoryError: Java heap space

2012-10-10 Thread Wolfgang Laun
On 10/10/2012, Mahadevappa, Shobha shobha.mahadeva...@nttdata.com wrote:
 Is there anything that has to be taken care in case of a stateless session.
 I have a huge collection of facts that needs to get into the working memory
 and I fire ksession.execute(Collecton object);

That'll do - it calls dispose for you.
-W




 Regards,
 Shobha M | Senior Program Manager, AAD | NTT DATA Global Delivery Services
 Limited| w. +91-80-26659482 (Ext 3679) | v. 8814.3679 | m. +91.9972522743 |
 shobha.mahadeva...@nttdata.com


 -Original Message-
 From: rules-users-boun...@lists.jboss.org
 [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Wolfgang Laun
 Sent: 10 October 2012 PM 12:58
 To: Rules Users List
 Subject: Re: [rules-users] java.lang.OutOfMemoryError: Java heap space

 Just repeat this, as often as required, with as many facts in facts
 as you want:

 // copy-pasted from the API documentation ;-) StatefulKnowledgeSession
 ksession = kbase.newStatefulKnowledgeSession();
  for( Object fact : facts ) {
  ksession.insert( fact );
  }
  ksession.fireAllRules();
  ksession.dispose();

 -W


 On 09/10/2012, Brenda1636 brenda.chodkow...@ctg.com wrote:
 I've seen many posts about users receiving a java.lang.OutOfMemoryError:
 Java heap space error. The answer have been to increase heap space. I
 was wondering if there is another way around this.

 I have about 10,000 facts that I want to bring into working memory. Is
 there a way to insert some of them, run the rules, remove the inserted
 ones, and then insert more?

 Thanks!



 --
 View this message in context:
 http://drools.46999.n3.nabble.com/java-lang-OutOfMemoryError-Java-heap
 -space-tp4020185.html Sent from the Drools: User forum mailing list
 archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users

 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users

 __
 Disclaimer:This email and any attachments are sent in strictest confidence
 for the sole use of the addressee and may contain legally privileged,
 confidential, and proprietary data.  If you are not the intended recipient,
 please advise the sender by replying promptly to this email and then delete
 and destroy this email and any attachments without any further use, copying
 or forwarding

 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] java.lang.OutOfMemoryError: Java heap space

2012-10-10 Thread Brenda1636
Thank you! I did write code for this last night and ran it, but didn't get
the results I wanted so I was thinking the session was disposed before it
had a chance to run the rules. But the real issue was that I did not write
my rule correctly.

Thanks again!




--
View this message in context: 
http://drools.46999.n3.nabble.com/java-lang-OutOfMemoryError-Java-heap-space-tp4020185p4020195.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] java.lang.OutOfMemoryError: Java heap space

2012-10-10 Thread mohan
Hi laune,

Assume we continuously getting vast number of facts or events from a stream
and we want to reasoning over particular time window (accumulate number of
events on this window) how we could achieve the same? Guess we cannot call
dispose() after fireAllRules().



--
View this message in context: 
http://drools.46999.n3.nabble.com/java-lang-OutOfMemoryError-Java-heap-space-tp4020185p4020206.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] java.lang.OutOfMemoryError: Java heap space

2012-10-09 Thread Brenda1636
I've seen many posts about users receiving a java.lang.OutOfMemoryError:
Java heap space error. The answer have been to increase heap space. I was
wondering if there is another way around this.

I have about 10,000 facts that I want to bring into working memory. Is there
a way to insert some of them, run the rules, remove the inserted ones, and
then insert more? 

Thanks!



--
View this message in context: 
http://drools.46999.n3.nabble.com/java-lang-OutOfMemoryError-Java-heap-space-tp4020185.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] java.lang.OutOfMemoryError: Java heap space on Drools 4.0.4

2008-01-21 Thread Christopher . Mathrusse
Allocate more memory for the JVM when starting the application/server. As 
an example, pass the following in to the JVM on startup:
-Xms128m -Xmx256m

By default, the JVM only allocate 64M of memory. You simply need to tell 
the JVM to allocate more.





Shiva Shankar Reddy Katula [EMAIL PROTECTED] 
Sent by: [EMAIL PROTECTED]
01/21/2008 10:38 PM
Please respond to
Rules Users List rules-users@lists.jboss.org


To
Rules Users List rules-users@lists.jboss.org
cc

Subject
[rules-users] java.lang.OutOfMemoryError: Java heap space on Drools 4.0.4






Hi,
 
I am getting the following outofmemory error after upgrading from 3.0.x to 
4.0.4. 
I use to never get this error before. 
I don't think this is because of system memory issue. 
 
I have 8 GB RAM Linux Machine with JBOSS Server.
 
Do anybody have this issue if so what is the resolution.
 
 
22:22:38,177 ERROR [STDERR] Exception in thread Timer-354
22:22:38,177 ERROR [STDERR] java.lang.OutOfMemoryError: Java heap space
22:22:38,177 ERROR [STDERR] at 
java.lang.StringCoding.trim(StringCoding.java:64)
22:22:38,177 ERROR [STDERR] at 
java.lang.StringCoding.access$400(StringCoding.java:37)
22:22:38,177 ERROR [STDERR] at 
java.lang.StringCoding$CharsetSE.encode(StringCoding.java:353)
22:22:38,177 ERROR [STDERR] at 
java.lang.StringCoding.encode(StringCoding.java:378)
22:22:38,177 ERROR [STDERR] at 
java.lang.StringCoding.encode(StringCoding.java:384)
22:22:38,177 ERROR [STDERR] at 
java.lang.String.getBytes(String.java:829)
22:22:38,183 ERROR [STDERR] at 
org.drools.rule.builder.dialect.java.JavaDialect.addClassCompileTask(JavaDialect.java:472)22:22:38,183
 
ERROR [STDERR] at 
org.drools.rule.builder.dialect.java.JavaDialect.addFunction(JavaDialect.java:442)
22:22:38,183 ERROR [STDERR] at 
org.drools.compiler.PackageBuilder.addFunction(PackageBuilder.java:406)
22:22:38,183 ERROR [STDERR] at 
org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:289)
22:22:38,183 ERROR [STDERR] at 
org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:167)
 
Thanks,
Shiva
Tel: +91-40-27782000 Ext: 4259
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] java.lang.OutOfMemoryError: Java heap space

2007-11-12 Thread vdelbart

Hello,

I add this 4 lines in my code before the session.dispose() and the problem
disapear :

session.removeEventListener((WorkingMemoryEventListener)logger);
session.removeEventListener((AgendaEventListener)logger);
session.removeEventListener((RuleFlowEventListener)logger);
session.removeEventListener((RuleBaseEventListener)logger);

regards,

V.



vdelbart wrote:
 
 Good morning,
 
 I found a workaround : don't use the WorkingMemoryFileLogger !
 
 I create an issue : http://jira.jboss.com/jira/browse/JBRULES-1325
 
 regards,
 
 V.
 
 
 vdelbart wrote:
 
 Hello,
 
 In my tests of the 4.0.3, I have some :  java.lang.OutOfMemoryError.
 
 So, I try a simple test with 10.000 sequential execution of 1 rule with
 no context and just a workingmemorylogger and I have the error :
 java.lang.OutOfMemoryError: Java heap space
 
 My code is :
 
 public class ExecReglesMemotyTest
 {
 
  private static final Reader DRL = new
 InputStreamReader(ExecReglesMemotyTest.class
  .getResourceAsStream(/rules/exemple.drl));
 
  private static final String FICHIER_LOG = session;
 
  /**
   * @param args
   */
  public static void main(String[] args)
  {
  try
  {
  PackageBuilder builder = new PackageBuilder();
  builder.addPackageFromDrl(DRL);
  RuleBase ruleBase = RuleBaseFactory.newRuleBase();
  ruleBase.addPackage(builder.getPackage());
  for (int i = 0; i  1; i++)
  {
  StatefulSession session = 
 ruleBase.newStatefulSession();
  WorkingMemoryFileLogger logger = new
 WorkingMemoryFileLogger(session);
  logger.setFileName(FICHIER_LOG);
  session.fireAllRules();
  logger.writeToDisk();
  session.dispose();
  }
 
  }
  catch (Exception e)
  {
  // TODO Auto-generated catch block
  e.printStackTrace();
  }
  }
 }
 
 with this rule (doesn't matter):
 #created on: Fri Nov 09 15:48:45 CET 2007
 package initPackage
 
 #list any import classes here.
 
 rule ERG9
 when
 
 then
 
 end
 
 I try this in 4.0.1, and it's working (no OutOfMemoryError)
 
 What's the problem ?
 
 thanks for any information,
 
 V.
 
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/java.lang.OutOfMemoryError%3A-Java-heap-space-tf4779030.html#a13702134
Sent from the drools - user mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] java.lang.OutOfMemoryError: Java heap space

2007-11-12 Thread Edson Tirelli
   Thanks for reporting and providing workaround. I will look into fixing
that.

2007/11/12, vdelbart [EMAIL PROTECTED]:


 Hello,

 I add this 4 lines in my code before the session.dispose() and the problem
 disapear :

 session.removeEventListener((WorkingMemoryEventListener)logger);
 session.removeEventListener((AgendaEventListener)logger);
 session.removeEventListener((RuleFlowEventListener)logger);
 session.removeEventListener((RuleBaseEventListener)logger);

 regards,

 V.



 vdelbart wrote:
 
  Good morning,
 
  I found a workaround : don't use the WorkingMemoryFileLogger !
 
  I create an issue : http://jira.jboss.com/jira/browse/JBRULES-1325
 
  regards,
 
  V.
 
 
  vdelbart wrote:
 
  Hello,
 
  In my tests of the 4.0.3, I have some :  java.lang.OutOfMemoryError.
 
  So, I try a simple test with 10.000 sequential execution of 1 rule with
  no context and just a workingmemorylogger and I have the error :
  java.lang.OutOfMemoryError: Java heap space
 
  My code is :
 
  public class ExecReglesMemotyTest
  {
 
   private static final Reader DRL = new
  InputStreamReader(ExecReglesMemotyTest.class
   .getResourceAsStream(/rules/exemple.drl));
 
   private static final String FICHIER_LOG = session;
 
   /**
* @param args
*/
   public static void main(String[] args)
   {
   try
   {
   PackageBuilder builder = new PackageBuilder();
   builder.addPackageFromDrl(DRL);
   RuleBase ruleBase = RuleBaseFactory.newRuleBase();
   ruleBase.addPackage(builder.getPackage());
   for (int i = 0; i  1; i++)
   {
   StatefulSession session =
 ruleBase.newStatefulSession();
   WorkingMemoryFileLogger logger = new
  WorkingMemoryFileLogger(session);
   logger.setFileName(FICHIER_LOG);
   session.fireAllRules();
   logger.writeToDisk();
   session.dispose();
   }
 
   }
   catch (Exception e)
   {
   // TODO Auto-generated catch block
   e.printStackTrace();
   }
   }
  }
 
  with this rule (doesn't matter):
  #created on: Fri Nov 09 15:48:45 CET 2007
  package initPackage
 
  #list any import classes here.
 
  rule ERG9
  when
 
  then
 
  end
 
  I try this in 4.0.1, and it's working (no OutOfMemoryError)
 
  What's the problem ?
 
  thanks for any information,
 
  V.
 
 
 
 
 

 --
 View this message in context:
 http://www.nabble.com/java.lang.OutOfMemoryError%3A-Java-heap-space-tf4779030.html#a13702134
 Sent from the drools - user mailing list archive at Nabble.com.

 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users




-- 
  Edson Tirelli
  Software Engineer - JBoss Rules Core Developer
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646
  JBoss, a division of Red Hat @ www.jboss.com
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] java.lang.OutOfMemoryError: Java heap space

2007-11-09 Thread vdelbart

Hello,

In my tests of the 4.0.3, I have some :  java.lang.OutOfMemoryError.

So, I try a simple test with 10.000 sequential execution of 1 rule with no
context and just a workingmemorylogger and I have the error :
java.lang.OutOfMemoryError: Java heap space

My code is :

public class ExecReglesMemotyTest
{

private static final Reader DRL = new
InputStreamReader(ExecReglesMemotyTest.class
.getResourceAsStream(/rules/exemple.drl));

private static final String FICHIER_LOG = session;

/**
 * @param args
 */
public static void main(String[] args)
{
try
{
PackageBuilder builder = new PackageBuilder();
builder.addPackageFromDrl(DRL);
RuleBase ruleBase = RuleBaseFactory.newRuleBase();
ruleBase.addPackage(builder.getPackage());
for (int i = 0; i  1; i++)
{
StatefulSession session = 
ruleBase.newStatefulSession();
WorkingMemoryFileLogger logger = new 
WorkingMemoryFileLogger(session);
logger.setFileName(FICHIER_LOG);
session.fireAllRules();
logger.writeToDisk();
session.dispose();
}

}
catch (Exception e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}

with this rule (doesn't matter):
#created on: Fri Nov 09 15:48:45 CET 2007
package initPackage

#list any import classes here.

rule ERG9
when

then

end

I try this in 4.0.1, and it's working (no OutOfMemoryError)

What's the problem ?

thanks for any information,

V.


-- 
View this message in context: 
http://www.nabble.com/java.lang.OutOfMemoryError%3A-Java-heap-space-tf4779030.html#a13671498
Sent from the drools - user mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users