title: How can I get the memory usage of a worker created by worker_threads in nodejs
body: <p>I created a worker using the worker_threads. Like this:</p>
  <pre><code>const WorkerThreads = require('worker_threads');
  const worker = new WorkerThreads.Worker('./path/to/a.js');
  
  if (countMemory(worker) &gt; 100 * 1024 * 1024) {
      worker.terminate();
  }
  
  function countMemory(worker) {
      // some code I don't know
  }
  </code></pre>
  <p>And I knew that the <code>./path/to/a.js</code> has a little bit memory leak, so I have to destory the Worker when it  leak a lot. How can I get how many memory did the Worker use?</p>