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

Reduce memory usage of QueryResult

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

      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.

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

              Created:
              Updated:
              Resolved: