Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

322
Views
JS heap out of memory: Determining how much memory application needs

I have an application that reads from JSON files and adds the data to a Kafka producer. As we're dealing with 5MB/s I needed to multithread this process. I have 3 workers reading files and 7 workers writing to Kafka. However, no matter what I do I keep getting the same error.

FATAL: Error: Worker terminated due to reaching memory limit: JS heap out of memory
    at new NodeError (node:internal/errors:372:5)
    at Worker.[kOnExit] (node:internal/worker:276:26)
    at Worker.<computed>.onexit (node:internal/worker:198:20) {
  code: 'ERR_WORKER_OUT_OF_MEMORY'
}

I've changed how much heap space (up to 16GB!) Javascript runs with by setting

NODE_OPTIONS=--max-old-space-size=$((16 * 1024))

But no matter what I do I keep running out of memory after around 20 minutes or so. How can I make sure I don't run out of memory?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!