0

There are two separate structures that I use splitter and aggregator in Spring integration,

When I perform a load test on the system, the memory (heap) used by the service that implements Aggregator increases at the same rate to the data I feed and remains constant. Is there something I am using wrong?

I delete the message groups when they are completed and when I check the count, the message group store returns 0.

The configuration,

CorrelationStrategy -> HeaderAttributeCorrelationStrategy,

MessageGroupStore -> SimpleMessageStore,

ReleaseStrategy -> SimpleSequenceSizeReleaseStrategy,

expireGroupsUponCompletion -> true,

I'm running a MessageGroupStoreReaper every 10 seconds and the timeout is 30 seconds.

Thanks.

  • The `SimpleMessageStore` is not recommended for production anyway, since it may lose your data when app is crashed. Plus with persistent, external store you can easily achieve distribution computation. Anyway it would be grate to have some simple project from your to play with and reproduce. Thanks for understanding. – Artem Bilan Oct 01 '21 at 19:30
  • Thank you, Here is an example usage that I can send: `IntegrationFlows.from("myChannel") .aggregate(spec -> spec .correlationStrategy(correlationStrategy) .releaseStrategy(releaseStrategy) .messageStore(messageGroupStore) .expireGroupsUponCompletion(true)) .handle(message -> { // my handler }) .get();` – Sefa Mert Kaya Oct 01 '21 at 19:38
  • No, that's not enough. We really need the whole project to be able to run om our side. This way we indeed are going to be on the same page. Plus some instructions how to be sure that we see an OOM issue. Just because whatever you describe must work as is. That `expireGroupsUponCompletion(true)` does the trick to remove released `MessageGroup`s from in-memory store. – Artem Bilan Oct 01 '21 at 19:41
  • I'll review my code and come back, thanks for the quick response, I need an in-memory store, if you say expireGroupsUponCompletion(true) definitely deletes completed groups from memory, I'll review my load test scenario. – Sefa Mert Kaya Oct 01 '21 at 21:10
  • It does remove from the store, but still produces it as a result from the aggregator – Artem Bilan Oct 01 '21 at 21:20
  • Hi again, There was a point I missed in the Aggregator Document. "When you use a SimpleMessageStore for the aggregator, that original Collection is cleared after releasing the group" My understanding is that the messages in the MessageGroup are deleted even if the MessageGroup itself was not deleted in the Default Configuration. I noticed after I got Heap Dump. This is important information for me, thanks again. – Sefa Mert Kaya Oct 02 '21 at 22:19
  • So, is all good now? Do you have an answer? Can you share it as the one for your question and accept it yourself to let community to benefit from your experience ? – Artem Bilan Oct 03 '21 at 03:16

1 Answers1

0

Spring Integration was not creating a memory leak for my problem, Because the Collection<Message> in it is already cleaned after the group is released, one of the concerns here may be the memory occupied by the groups. You can use expireGroupsUponCompletion(true) for this, so it will be cleared after the group is released.

In addition, you can configure groupTimeout to secure your work for Memory leak problem.