Hi!
How many workers (worker_threads) can I make?
Are any limits (per core, per thread, etc.?)?
I have a very huge memory leak with 30 workers (CPU 6 cores, 12 threads, i7-8700), it will be around 3-4gb ram, without worker threads around 200-300mb. Wtf? Is it a bug?
And I have an error with MaxListenersExceededWarning.
Are you able to provide code that reproduces the issue?
And can you fill out the issue template while you're at it? We ask it for a reason.
Closing for now, no follow-up from OP.
So I have array storage in the main file.
For ex.:
main.js
let store = []
worker.on('message', items => {
store = store.concat(items)
if (store.length > N) {
...someActionWithStore()
store = []
}
})
worker.js
setInterval(() => {
const items = getItems() // around 200 items per iteration
parentPort.postMessage(items)
}, 1000)
Active workers: ~50
RAM: 3-4gb
Without workers RAM: 300-500mb.
Most helpful comment
And can you fill out the issue template while you're at it? We ask it for a reason.