Uploaded image for project: 'VS Code Extension'
  1. VS Code Extension
  2. VSCODE-657

Investigate high memory usage for tests in CI

    • Type: Icon: Investigation Investigation
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Developer Tools

      From mongosh, test_vscode, we noticed potentially high usage of memory in VSCode tests: https://github.com/mongodb-js/mongosh/pull/2239

      It might be worth investigating why this is happening in case there are some memory leaks either in our CI / test setup or even the extension itself.

      I briefly gave this a go and used this MemoryUsageReporter with Mocha and did not see any tests > 10mb usage so perhaps a lot of it comes from setup or other factors. It may also just be the memory associated with spinning up electron.

      class MemoryUsageReporter extends Mocha.reporters.Base {  constructor(runner) {    super(runner);
          runner.on('test', (test) => {      test.memoryUsageBefore = process.memoryUsage().heapUsed;    });
          runner.on('test end', (test) => {      const memoryUsageAfter = process.memoryUsage().heapUsed;      const memoryUsageDiff =        (memoryUsageAfter - test.memoryUsageBefore) / (1024 * 1024);
            if (memoryUsageDiff > 1000) {        console.log('==== HEAVY TEST ====');      }
            console.log(        `Memory usage for test "${test.title}": ${memoryUsageDiff.toFixed(          2        )} MB`      );    });  }} 

            Assignee:
            Unassigned Unassigned
            Reporter:
            gagik.amaryan@mongodb.com Gagik Amaryan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: