Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-20392

Improve default allocation size in N1QL projection

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 4.5.1, 5.0.0
    • 4.5.0
    • query
    • None

    Description

      The projection operator allocates extra memory to minimize resizing maps. This is causing excessive memory usage in some situations.

      Per Sitaram Vemulapalli:

      A customer reported high memory usage of query node. They use * and One of the place is below.
      Are we need to add +32 for ‘*’ also? Is there way we can calculate the right number form projection?
      Looks like n is 1 and 8.23GB around 30 * 297MB

      https://github.com/couchbase/query/blob/master/execution/project_initial.go#L100

      297.01MB   297.01MB     97:sv := value.NewScopeValue(make(map[string]interface{}, n), item)
               .      111MB     98:pv := value.NewAnnotatedValue(sv)
               .          .     99:pv.SetAnnotations(item)
               .          .    100:
          8.23GB     8.23GB    101:p := value.NewValue(make(map[string]interface{}, n+32))
      

      Attachments

        Issue Links

          For Gerrit Dashboard: MB-20392
          # Subject Branch Project Status CR V

          Activity

            People

              Sitaram.Vemulapalli Sitaram Vemulapalli
              gerald Gerald Sangudi (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty