You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Switching workerpool from child_process to worker thread leads to OOM error. Currently, there is only one worker configured and only one task in the queue. After a worker has initialized, any DB connection-related activity (createConnection, exec, or even rollback) is performed in the main thread, the main node process crashes with an error,
workerpool options are as below, {"minWorkers":1,"maxWorkers":1,"workerType":"thread","workerThreadOpts":{"resourceLimits":{"maxOldGenerationSizeMb":768}}
The memory usage of main node process during this activity is as below,
Is it normal to see the surge in RSS memory usage to rise from 215MB to 378MB for one worker thread?
Any idea why I see OOM error despite setting --max-old-space-size=8192 for the main node process?
Thanks
The text was updated successfully, but these errors were encountered:
@VP-0822 maybe you can take one of the simple examples provided with the library, for example dedicatedWorker.js, remove the pool..terminate(), and monitor how that behaves on your machine, and see what memory it uses for process vs thread.
It's hard to tell why the OOM error occurs without actually debugging it. An important difference with worker_threads is that they share memory with the main process, where as a child_process has it's own memory. Suppose both your main process and your worker use 6GB of memory. That will work fine with child_process when you have --max-old-space-size=8192, but will be a problem if you use worker threads since the total memory is 12 GB, above the max of 8GB.
The following node.js issue may be relevant too since I see you're configuring both --max-old-space-size=8192 and "maxOldGenerationSizeMb":768: nodejs/node#43991.
Switching workerpool from child_process to worker thread leads to OOM error. Currently, there is only one worker configured and only one task in the queue. After a worker has initialized, any DB connection-related activity (createConnection, exec, or even rollback) is performed in the main thread, the main node process crashes with an error,
workerpool options are as below,
{"minWorkers":1,"maxWorkers":1,"workerType":"thread","workerThreadOpts":{"resourceLimits":{"maxOldGenerationSizeMb":768}}
The memory usage of main node process during this activity is as below,
--max-old-space-size=8192
for the main node process?Thanks
The text was updated successfully, but these errors were encountered: