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

Reduce memory usage of QueryResult

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Works as Designed
    • Affects Version/s: 3.6.0
    • Fix Version/s: None
    • Component/s: Internal, Performance
    • Labels:
      None

      Description

      QueryResult uses a list to store items, which results in excessive memory usage and unnecessary CPU load.

      Indeed, the MongoIterable API is streaming oriented with the functions forEach and iterator, it does not require the use of a list in the background.

      In addition, this prevents the use of reusable objects in a ThreadLocal to limit the creation of these and further improve the memory footprint.

        Attachments

          Activity

            People

            Assignee:
            ross.lawley Ross Lawley
            Reporter:
            vgilles Vincent GILLES
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: