Uploaded image for project: 'MongoDB Shell'
  1. MongoDB Shell
  2. MONGOSH-1330

nanobus usage leaks memory

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.6.2
    • Affects Version/s: 1.6.1
    • Component/s: CLI Module
    • None
    • 1
    • Iteration Porpoise
    • Not Needed

      Reported in https://mongodb.slack.com/archives/CUHC9R8J0/p1669893135423849

      Shell API calls lead to an event being emitted on the mongosh bus, which currently is a `nanobus` instance, which defaults to emitting a performance entry through the Node.js version of the web’s performance API.

      These performance entries are never garbage collected, making the process fail with an OOM crash. E.g.:

      $ env NODE_OPTIONS=--max-old-space-size=96 mongosh --quiet --eval "i = 0; while (1) { i++; if (i % 10000 === 0) print(i); config.get(''); }"
      10000
      20000
      30000
      40000
      50000
      60000
      
      <--- Last few GCs --->
      

      Note that this does not reproduce if DISABLE_NANOTIMING=1 is set on the environment.

            Assignee:
            anna.henningsen@mongodb.com Anna Henningsen
            Reporter:
            anna.henningsen@mongodb.com Anna Henningsen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: