Hi,<br><br>I&#39;ve recently started using some of the temporal operators 
that drools supports (coincides, starts, finishes, during) and have had 
trouble with events not being expired, causing severe memory 
consumption.<br>
I&#39;d first like to make sure that I&#39;m using these operators appropriately, so as a test case I have rules like:<br><br>declare A<br>  @role( event )<br>  @timestamp( timestamp )<br>  @duration( duration )<br>end<br>


<br>declare B<br>  @role( event )<br>  @timestamp( timestamp )<br>  @duration( duration )<br>end<br><br>rule &quot;coincides events&quot;<br>when<br>  $a: A() from entry-point &quot;a&quot;<br>  $b: B(this coincides $a) from entry-point &quot;b&quot;<br>


then insert(&quot;coincides&quot;); end<br><br>With classes like:<br><br>public class A{<br>        public final long timestamp;<br>        public final long duration;<br>        public A(long timestamp, long duration){<br>


            this.timestamp = timestamp;<br>            this.duration = duration;<br>        }<br>}<br><br>//B is identical to A.<br><br>Using a knowledge base configured with stream mode, and a knowledge session with a pseudo clock I&#39;d run this test:<br>


<br>A a = new A(0, 1000);<br>B b = new B(0, 1000);<br>        <br>entryPointA.insert(a);<br>entryPointB.insert(b);<br>clock.advanceTime(1000, TimeUnit.MILLISECONDS);<br>ksession.fireAllRules();<br><br>In
 this test I&#39;m expecting that the rule will fire to insert &quot;coincides&quot; 
and expire both A and B.  But instead, &quot;coincides&quot; is inserted, B is 
expired, but A remains in memory permanently.  If I use jvisualvm to 
inspect the expirationOffset for A, I see that it is the Long.MAX value 
of 9223372036854775807.  This behavior persists even after adding an 
explicit expiration to A.  I was under the impression that the offset 
would be zero (of close to it) since Drools would only need to retain A 
until the clock reaches A&#39;s endTimestamp.  The documentation does not 
cover the calculation of event expiration in great detail, so have I 
missed something?  Thanks in advance.