LEAK : ByteBuf.release was not called

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Unknown
    • 5.6.3
    • Affects Version/s: 5.6.2
    • Component/s: Wire Protocol
    • None
    • None
    • Java Drivers
    • Not Needed
    • None
    • None
    • None
    • None
    • None
    • None

      Summary

      When using MongoDB Java Driver version 5.6.2 in combination with JDK 25.0.1 and Netty 4.2.9 (as provided by Spring Boot 4.0.1), a ByteBuf leak is reported at runtime:

      “LEAK: ByteBuf.release() was not called before it’s garbage-collected”

      The same application setup does not show this issue when using MongoDB Java Driver version 5.5.2. This suggests a regression introduced between driver versions 5.5.2 and 5.6.2 related to Netty buffer lifecycle management.

      The corresponding Netty leak log for a single leak is attached to this issue.

      Expected Result
      No ByteBuf leak warnings should be reported.

      Control Test
      Downgrading only the MongoDB Java Driver to version 5.5.2 while keeping all other components identical removes the leak warning completely.

        1. leak1.txt
          562 kB
        2. mongodb-leak.log
          420 kB
        3. Leak ByteBuf.release.log
          5 kB
        4. image-2026-01-29-16-54-21-060.png
          image-2026-01-29-16-54-21-060.png
          85 kB

            Assignee:
            Ross Lawley
            Reporter:
            Michael Cornelius
            Valentin Kavalenka
            Votes:
            5 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              Resolved: