[jboss-jira] [JBoss JIRA] (DROOLS-2409) Memory Leak in sliding window

Mike Baranski (JIRA) issues at jboss.org
Thu Mar 22 09:21:00 EDT 2018


    [ https://issues.jboss.org/browse/DROOLS-2409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13549776#comment-13549776 ] 

Mike Baranski commented on DROOLS-2409:
---------------------------------------

Agreed on the fact that this is not *really* a great real-world example.  Perhaps better is a "batch" like example where we add maybe 200 records at a time and sleep in between:

```
for (i = 0; i < 10000000; i++) {
                averageMeasurementService.addMeasurement(new Measurement(random.nextInt(100)));
                if (i % 100000 == 0) {
                    System.out.println(i + " inserted into list of " + averageMeasurementService.getFactCount());
                    Thread.sleep(500l);
                }
                if (i % 200 == 0) {
                    Thread.sleep(100l);
                }
            }
```

This sleeps 100 ms each 200 events, which drools seems to be able to handle OK for the first few million at least.

This starts to really degrade the performance:

```
for (i = 0; i < 10000000; i++) {
                averageMeasurementService.addMeasurement(new Measurement(random.nextInt(100)));
                if (i % 100000 == 0) {
                    System.out.println(i + " inserted into list of " + averageMeasurementService.getFactCount());
                    Thread.sleep(500l);
                }
                if (i % 200 == 0) {
                    Thread.sleep(10l);
                }
            }
```

In fact, with the above, it looks like maybe the event counter is overflowing:

{quote}
6200000 inserted into list of -1170
zzZZzz: 49.609819277108436
zzZZzz: 49.63111764705882
zzZZzz: 49.31702380952381
zzZZzz: 49.355625
6300000 inserted into list of 20459
zzZZzz: 49.52712348322627
zzZZzz: 49.58170454545454
6400000 inserted into list of 70065
{quote}

> Memory Leak in sliding window
> -----------------------------
>
>                 Key: DROOLS-2409
>                 URL: https://issues.jboss.org/browse/DROOLS-2409
>             Project: Drools
>          Issue Type: Feature Request
>          Components: core engine
>    Affects Versions: 7.6.0.Final
>         Environment: Mac with Java 1.8 using Spring Boot (see attached demo project)
>            Reporter: Mike Baranski
>            Assignee: Mario Fusco
>            Priority: Critical
>         Attachments: complete.tar.gz
>
>
> See attached project.
> `gradle test` causes an out of memory exception on my machine after ~2.6 million events.  Events should be released for GC after 1 second, but that does not appear to be happening.



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the jboss-jira mailing list