[ https://issues.apache.org/jira/browse/FLINK-7606?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16163046#comment-16163046 ]
Matteo Ferrario commented on FLINK-7606: ---------------------------------------- In order to test the job, we configured JMeter to execute a cycle of 100 iterations every second, per 5 minutes. For each iteration of the cycle, JMeter sends to RabbitMQ two messages that match the pattern. These messages: * have the same 'deviceCode' (field 'deviceCode' is the key used to partitionate the stream) * the first has 'phase' = 'Idle' * the second has 'phase' = 'Start' The total number of messages send to Rabbit is 60.000 (30.000 with 'phase' = 'Idle' and 30.000 with 'phase' = 'Start'). The expectation is to have 30.000 events generated. We executed the same test three times, one after another: * in the first run the number of events generated was 29.997 * in the second run the number of events generated was 29.987 * in the third run the number of events generated was 29.989 We also see the heap dumps of flink, taken after each run of the test. In these heap dumps, we can see that the memory used by NestedMapsStateTable grows up continuosly: * after the first run it was about 24 MB ([^heap-dump1.png]) * after the second run it was about 51 MB ([^heap-dump2.png]) * after the third run it was about 78 MB ([^heap-dump3.png]) Also the "within" clause didn't help: we did an heap dump after 10 minutes but it was like the one done after just the third run. > Memory leak on NestedMapsStateTable > ----------------------------------- > > Key: FLINK-7606 > URL: https://issues.apache.org/jira/browse/FLINK-7606 > Project: Flink > Issue Type: Bug > Components: CEP > Affects Versions: 1.3.1 > Reporter: Matteo Ferrario > Attachments: heap-dump1.png, heap-dump2.png, heap-dump3.png > > > The NestedMapsStateTable grows up continuously without free the heap memory. > We created a simple job that processes a stream of messages and uses CEP to > generate an outcome message when a specific pattern is identified. > The messages coming from the stream are grouped by a key defined in a > specific field of the message. > We've also added the "within" clause (set as 5 minutes), indicating that two > incoming messages match the pattern only if they come in a certain time > window. > What we've seen is that for every key present in the message, an NFA object > is instantiated in the NestedMapsStateTable and it is never deallocated. > Also the "within" clause didn't help: we've seen that if we send messages > that don't match the pattern, the memory grows up (I suppose that the state > of NFA is updated) but it is not cleaned also after the 5 minutes of time > window defined in "within" clause. > If you need, I can provide more details about the job we've implemented and > also the screenshots about the memory leak. -- This message was sent by Atlassian JIRA (v6.4.14#64029)