Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-591

Long-running tailable cursors consume too much memory

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 2.13.0
    • 2.7.2
    • Query Operations
    • None

    Description

      I already posted it on the mailing list, it didn't receive any replies, but I still think it's a bug. Please correct me if I'm wrong.

      A tailable cursor on a capped collection can live potentially for a long time and return multiple batches of data.
      However, it seems to me that the size of each batch that is read from Mongo is added to the list: DBApiLayer.Result._sizes, in the DBApiLayer.Result.init method, called from the _advance method.

      The list is available via DBCursor.getSizes().

      If the list grows and grows, especially if there's a lot of data added to the capped collection, eventually it will OOM.

      Is that right?

      UPDATE:

      Added DBCursor.disableBatchSizeTracking() to work around this problem.

      Attachments

        Activity

          People

            jeff.yemin@mongodb.com Jeffrey Yemin
            adamw1pl Adam Warski
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: