Uploaded image for project: 'Spring Integration'
  1. Spring Integration
  2. INT-4530

Memory leak via micrometer + dynamic flows

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: 5.0.8
    • Fix Version/s: 5.1 GA
    • Component/s: Core
    • Labels:

      Description

      org.springframework.integration.channel.AbstractMessageChannel registers io.micrometer.core.instrument.Meter instances, but never de-registers them (nor do I see any way to do that in Micrometer, though).

      This, combined with dynamic flows and enough channels being created, leads to a memory leak rather quickly.

      I've noticed this one after having turned on micrometer metrics and leaving the application running for a few days - the application creates a few hundred of dynamic flows, with around 20k channels, every day. Given enough messages passing through these channels, the amount of memory occupied by  com.codahale.metrics.WeightedSnapshot.WeightedSample  et al. quickly blows the roof off the top of the app's heap.

        Attachments

          Activity

            People

            • Assignee:
              grussell Gary Russell
              Reporter:
              timurstrekalov Timur Strekalov
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: