简体   繁体   中英

How to make Jemalloc Work in NodeJS Server running on Heroku

I am doing some image manipulation on the server side with a library called sharp . Unfortunately sharp is consuming so much memory during image transformation which ultimately leads to crashing the server every time. This is weird.

After several hours of digging,I was asked to add jemalloc heroku build pack to my buildpacks which I did using the command below:

heroku buildpacks:add --index 1 https://github.com/gaffneyc/heroku-buildpack-jemalloc.git

After which I deployed and restarted the server. Yet, the app is still crashing, so it seems Jemalloc is not yet activated.

Is there something else I can do to ensure Jemalloc is reducing the memory spike and prevent my server from constant crash?

Thank you

Just add jemalloc.sh before your script inside Procfile. Or set JEMALLOC_ENABLED variable to true.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM