title: Puppeteer: Chromium instances remain active in the background after browser.disconnect
body: <p><strong>My environment</strong></p>
  
  <ul>
  <li>Puppeteer version: 3.1.0</li>
  <li>Platform / OS version: Windows 10</li>
  <li>Node.js version: 12.16.1</li>
  </ul>
  
  <p><strong>My problem is:</strong> </p>
  
  <p>I have a <code>for...of</code> loop to visit 3000+ urls with puppeteer. I use <code>puppeteer.connect</code> to <code>wsEndpoint</code> so I can reuse one browser instance. I disconnect after each visit and close the tab.</p>
  
  <ul>
  <li>first 100 urls <code>page.goto</code>'s open the urls immediately,</li>
  <li>above 100 <code>page.goto</code> uses 2-3 retries per url,</li>
  <li>above 300 <code>page.goto</code> uses 5-8 retries per url,</li>
  <li>above 500 I get <code>TimeoutError: Navigation timeout of 30000 ms exceeded</code> all the time.</li>
  </ul>
  
  <p>I checked the Windows Task Manager and I realized hundreds of Chromium instances running in the background and using 80-90MB of memory each and 1-2% of CPU as well.</p>
  
  <p><strong>Question</strong></p>
  
  <p>How can I kill the Chromium instances I've already disconnected with <code>browser.disconnect</code> for real?</p>
  
  <p><strong>Example script</strong></p>
  
  <pre class="lang-js prettyprint-override"><code>const puppeteer = require('puppeteer')
  const urlArray = require('./urls.json') // contains 3000+ urls in an array
  
  
  async function fn() {
    const browser = await puppeteer.launch({ headless: true })
    const browserWSEndpoint = await browser.wsEndpoint()
  
    for (const url of urlArray) {
      try {
        const browser2 = await puppeteer.connect({ browserWSEndpoint })
        const page = await browser2.newPage()
        await page.goto(url) // in my original code it's also wrapped in a retry function
  
        // doing cool things with the DOM
  
        await page.goto('about:blank') // because of you: https://github.com/puppeteer/puppeteer/issues/1490
        await page.close()
        await browser2.disconnect()
      } catch (e) {
        console.error(e)
      }
    }
    await browser.close()
  }
  fn()
  </code></pre>
  
  <p><strong>The error</strong></p>
  
  <p>The usual puppeteer timeout error.</p>
  
  <pre><code>TimeoutError: Navigation timeout of 30000 ms exceeded
      at C:\[...]\node_modules\puppeteer\lib\LifecycleWatcher.js:100:111
    -- ASYNC --
      at Frame.&lt;anonymous&gt; (C:\[...]\node_modules\puppeteer\lib\helper.js:94:19)
      at Page.goto (C:\[...]\node_modules\puppeteer\lib\Page.js:476:53)
      at Page.&lt;anonymous&gt; (C:\[...]\node_modules\puppeteer\lib\helper.js:95:27)
      at example (C:\[...]\example.js:13:18)
      at processTicksAndRejections (internal/process/task_queues.js:97:5) {
    name: 'TimeoutError'
  }
  
  </code></pre>