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

231
Views
Increase memory limit in nodejs

I am trying to increase memory limit in node, so I added an environment variable

here is how I did it

it does not work not sure why I also tried it with capital letters here is how I test it

 const maxHeapSz = require('v8').getHeapStatistics().heap_size_limit;
 const maxHeapSz_GB = (maxHeapSz / 1024 ** 3).toFixed(1);
 console.log(`${maxHeapSz_GB}GB`);

I keep gettin 2GB, I'm trying to get 8GB

I appreciate any help

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

You can use

node --max-old-space-size=8192 app.js

It's work for me!

Result:

node --max-old-space-size=8192 test.js 
8.0GB
about 4 years ago · Juan Pablo Isaza Report

0

The actual memory that is consumed by the application (in the form of objects in the JavaScript heap) is represented by heapUsed field in process.memoryUsage() API.

You can check for more information here. This article also shows methods to increase the maximum heap size.

about 4 years ago · Juan Pablo Isaza Report
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!