Re: [rules-users] Best practice to use heap memory effectively

2012-11-11 Thread mohan
Hi Gurus,

any ideas  views on above??



--
View this message in context: 
http://drools.46999.n3.nabble.com/Best-practice-to-use-heap-memory-effectively-tp4020194p4020793.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] Best practice to use heap memory effectively

2012-11-11 Thread Mark Proctor
It sounds like you are putting in facts without allowing them to be expired or 
retracted. If you keep inserting events over 24 hours, if there is enough of 
them, it will OOM. Try setting an expiration value for the event type, to force 
it to expire earlier.

Mark
On 12 Nov 2012, at 05:20, mohan mohan.narang...@gmail.com wrote:

 Hi Gurus,
 
 any ideas  views on above??
 
 
 
 --
 View this message in context: 
 http://drools.46999.n3.nabble.com/Best-practice-to-use-heap-memory-effectively-tp4020194p4020793.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] Best practice to use heap memory effectively

2012-11-11 Thread Wolfgang Laun
You have received other suggestions as well, but we haven't seen
any reason from your side why these won't work.

I think that this is still the problem of sending an SMS to an address
which calls from a certain cell, if there are one or more messages
defined for that cell, and not send another one for the same address
and cell before 24 hours are elapsed.

Once again, you'll need to keep track of the first call, storing
an object FirstCall with caller's address, cell, message id and
(system) time and
rules to
  * discard calls when there is a matching object FirstCall not older
than 24hrs,
  * discard FirstCall if is older than 24hrs
  * create such an object FirstCall if it doesn't exist and send the message,

-W

On 12/11/2012, Mark Proctor mproc...@codehaus.org wrote:
 It sounds like you are putting in facts without allowing them to be expired
 or retracted. If you keep inserting events over 24 hours, if there is enough
 of them, it will OOM. Try setting an expiration value for the event type, to
 force it to expire earlier.

 Mark
 On 12 Nov 2012, at 05:20, mohan mohan.narang...@gmail.com wrote:

 Hi Gurus,

 any ideas  views on above??



 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Best-practice-to-use-heap-memory-effectively-tp4020194p4020793.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

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


Re: [rules-users] Best practice to use heap memory effectively

2012-11-08 Thread mohan
Even though i have upgraded my application (jboss-6.1.0.Final, Jboss ESB
4.11,drools-5.3.1.Final,mvel2-2.1.0.drools4) still I’m facing memory leak.
Application reached 15 GB heap while it ran 4 hours. While going through
series of forum post now I suspect that single StatefulSession cause the
damage (without dispose).
Still I couldn’t track the approach to use one very large long-running
StatefulKnowledgeSession containing all relevant operational data(facts) and
trigger reasoning process over  my CEP events (especially streaming events).
To be more precise below I’ll mention my use case.

•   I have X number of Cells have to pre-loaded in to WM.
•   If customer(c1) make a call (voice event) inside Cell(A) need to offer
free data product. -- insert customer(c1) to WM
•   Same customer(c1) not eligible for offer for subsequent calls made 
inside
Cell(A) during next 24 hours. --After 24 hours  customer(c1) fact retract
from WM.

How can we decide exact time finishes using the session to dispose? How can
we achieve above case (fusion sliding window) without single session?  




--
View this message in context: 
http://drools.46999.n3.nabble.com/Best-practice-to-use-heap-memory-effectively-tp4020194p4020753.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] Best practice to use heap memory effectively

2012-11-01 Thread mohan
Hi folks,
Still i'm struggling to solve memory issue. My application will hang up
after one day due to memory leak. I’m not calling session.dispose() and
think it was the main reason behind this. How can I keep events  accumulate
number of events inside WM in a particular day without a single static
StatefulKnowledgeSession?  

With kind regards,
Mohan




--
View this message in context: 
http://drools.46999.n3.nabble.com/Best-practice-to-use-heap-memory-effectively-tp4020194p4020646.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] Best practice to use heap memory effectively

2012-11-01 Thread mohan
Let's assume we need to calculate number of Alarm facts/events inserted into
WM over particular day. We will keep on adding facts throughout the day. If
this count greater than threshold let’s notify somebody.  Also we will
retract facts/events which are older than 24 hours. 
Can we handle this situation without single static StatefulKnowledgeSession? 

Simply can we count number of facts/events in a WM in a particular time
using multiple session? So I can call session.dispose() after each
insertion.



--
View this message in context: 
http://drools.46999.n3.nabble.com/Best-practice-to-use-heap-memory-effectively-tp4020194p4020656.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] Best practice to use heap memory effectively

2012-11-01 Thread Greg Barton
Why not just maintain a counter object in working memory?  Just increment it 
whenever an alarm fact is inserted.  Reset or retract it at the end of the day.



 From: mohan mohan.narang...@gmail.com
To: rules-users@lists.jboss.org 
Sent: Thursday, November 1, 2012 3:15 PM
Subject: Re: [rules-users] Best practice to use heap memory effectively
 
Let's assume we need to calculate number of Alarm facts/events inserted into
WM over particular day. We will keep on adding facts throughout the day. If
this count greater than threshold let’s notify somebody.  Also we will
retract facts/events which are older than 24 hours. 
Can we handle this situation without single static StatefulKnowledgeSession? 

Simply can we count number of facts/events in a WM in a particular time
using multiple session? So I can call session.dispose() after each
insertion.



--
View this message in context: 
http://drools.46999.n3.nabble.com/Best-practice-to-use-heap-memory-effectively-tp4020194p4020656.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] Best practice to use heap memory effectively

2012-11-01 Thread Wolfgang Laun
Are the 24 hour intervals fixed, i.e., from 0:00 to 24:00?  In this
case simply counting them is sufficient. You need rules at all.

-W


On 01/11/2012, mohan mohan.narang...@gmail.com wrote:
 Let's assume we need to calculate number of Alarm facts/events inserted into
 WM over particular day. We will keep on adding facts throughout the day. If
 this count greater than threshold let’s notify somebody.  Also we will
 retract facts/events which are older than 24 hours.
 Can we handle this situation without single static StatefulKnowledgeSession?

 Simply can we count number of facts/events in a WM in a particular time
 using multiple session? So I can call session.dispose() after each
 insertion.



 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Best-practice-to-use-heap-memory-effectively-tp4020194p4020656.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] Best practice to use heap memory effectively

2012-11-01 Thread mohan
Hi Greg,

yes that's the way i'm doing right now. To keep this count hope we need to
maintain single session. So we can’t dispose session and by the time will we
end up with memory exhaust?

Thanks a lot.



--
View this message in context: 
http://drools.46999.n3.nabble.com/Best-practice-to-use-heap-memory-effectively-tp4020194p4020659.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] Best practice to use heap memory effectively

2012-11-01 Thread Wolfgang Laun
Correction: You don't need rules at all.

On 01/11/2012, Wolfgang Laun wolfgang.l...@gmail.com wrote:
 Are the 24 hour intervals fixed, i.e., from 0:00 to 24:00?  In this
 case simply counting them is sufficient. You need rules at all.

 -W


 On 01/11/2012, mohan mohan.narang...@gmail.com wrote:
 Let's assume we need to calculate number of Alarm facts/events inserted
 into
 WM over particular day. We will keep on adding facts throughout the day.
 If
 this count greater than threshold let’s notify somebody.  Also we will
 retract facts/events which are older than 24 hours.
 Can we handle this situation without single static
 StatefulKnowledgeSession?

 Simply can we count number of facts/events in a WM in a particular time
 using multiple session? So I can call session.dispose() after each
 insertion.



 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Best-practice-to-use-heap-memory-effectively-tp4020194p4020656.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] Best practice to use heap memory effectively

2012-11-01 Thread Greg Barton
Can't you sum up counts from multiple sessions?  Remove the count from the 
session before you dispose and keep that total count around until the end of 
the day.

Unless there's something complex you need to do with all of the Alarm facts at 
the end of the 24 hour period there's no need to keep them around.



 From: mohan mohan.narang...@gmail.com
To: rules-users@lists.jboss.org 
Sent: Thursday, November 1, 2012 3:42 PM
Subject: Re: [rules-users] Best practice to use heap memory effectively
 
Hi Greg,

yes that's the way i'm doing right now. To keep this count hope we need to
maintain single session. So we can’t dispose session and by the time will we
end up with memory exhaust?

Thanks a lot.



--
View this message in context: 
http://drools.46999.n3.nabble.com/Best-practice-to-use-heap-memory-effectively-tp4020194p4020659.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] Best practice to use heap memory effectively

2012-11-01 Thread mohan
interval are not fixed. it should be sysdate+24 hours. (2 AM to next day 2
AM)



--
View this message in context: 
http://drools.46999.n3.nabble.com/Best-practice-to-use-heap-memory-effectively-tp4020194p4020663.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] Best practice to use heap memory effectively

2012-11-01 Thread Wolfgang Laun
On 01/11/2012, mohan mohan.narang...@gmail.com wrote:
 interval are not fixed. it should be sysdate+24 hours. (2 AM to next day 2
 AM)

You contradict yourself. 2am to 2am *is* fixed.

Just counting does not require a rule based system anyway.

-W




 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Best-practice-to-use-heap-memory-effectively-tp4020194p4020663.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] Best practice to use heap memory effectively

2012-11-01 Thread mohan
What I meant is 24 hour period start from when event insert into memory.  So
each event/fact has different 24 hour period. If you take whole picture it
is not fixed.

Simply can we count number of facts/events in a WM in a particular time
using multiple session? So I can call session.dispose() after each
insertion.

thanks.



--
View this message in context: 
http://drools.46999.n3.nabble.com/Best-practice-to-use-heap-memory-effectively-tp4020194p4020666.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] Best practice to use heap memory effectively

2012-11-01 Thread Michael Anstis
Is this not a use case for CEP with the session in stream mode and Drools
Fusion clearing up the obsolete Alarm events?

sent on the move

On 1 Nov 2012 21:13, mohan mohan.narang...@gmail.com wrote:

 What I meant is 24 hour period start from when event insert into memory.
  So
 each event/fact has different 24 hour period. If you take whole picture it
 is not fixed.

 Simply can we count number of facts/events in a WM in a particular time
 using multiple session? So I can call session.dispose() after each
 insertion.

 thanks.



 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Best-practice-to-use-heap-memory-effectively-tp4020194p4020666.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] Best practice to use heap memory effectively

2012-11-01 Thread Wolfgang Laun
Using multiple sessions is not applicable, it will just (heavily) increase
memory requirements.

How precise does this have to be?

For instance, counting all events arriving in the interval -mm-dd
hh:mm requires 24*60 objects EventsPerMinute per 24 hours. You can
keep track on the running total in one single fact. As soon as the
oldest EventsPerMinute becomes older that 24hrs, you retract it and
reduce the running total.

You can reduce the granularity to seconds, if necessary.

-W


On 01/11/2012, mohan mohan.narang...@gmail.com wrote:
 What I meant is 24 hour period start from when event insert into memory.
 So
 each event/fact has different 24 hour period. If you take whole picture it
 is not fixed.

 Simply can we count number of facts/events in a WM in a particular time
 using multiple session? So I can call session.dispose() after each
 insertion.

 thanks.



 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Best-practice-to-use-heap-memory-effectively-tp4020194p4020666.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] Best practice to use heap memory effectively

2012-11-01 Thread mohan
Ok. What I have realized is that I can maintain single
StatefulKnowledgeSession (without dispose) through the application and
retract facts once in a while. So ideally I should not face any memory
issue. Anyway I’ll try to upgrade drool version(5.1.1  5.4.0.Final) and see
whether there are any improvement in overall memory consumption.

Tks
Mohan



--
View this message in context: 
http://drools.46999.n3.nabble.com/Best-practice-to-use-heap-memory-effectively-tp4020194p4020669.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] Best practice to use heap memory effectively

2012-10-10 Thread mohan
Hi ,
I want to keep events valid for 24 hour period. Per day I’m getting over
1000K events  insert into session. I saw that heap usage increase
drastically because of this. What is the best practice to handle such a
situation? Do I need to choose some caching mechanism? 

Meantime I’m using “Statefulknowledge” session and use single session to
cater each event  never call session.dispose(). Will there be any impact?
I’m using Drool 5.1.1, jboss-5.1.0.GA, jre 1.6.0_33

Thanks.
Mohan



--
View this message in context: 
http://drools.46999.n3.nabble.com/Best-practice-to-use-heap-memory-effectively-tp4020194.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