-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory did not released back after process is complete #2700
Comments
Please make sure you have read and understood everything in #955, including that RSS includes memory that has been freed but not yet returned to the OS. If you still believe there is a problem, please can you provide a complete, standalone repo with all code and images that allows someone else to reproduce this consistently. In addition, as you're using jemalloc, please can you set |
@ArkjuniorK Were you able to make any progress with this? |
@lovell I was able to run the jemalloc.so.2 by passing it inside the pm2 ecosystem.config.js. But why sharp did not work with the default memory allocator in Linux distro such as manjaro and centos? Or it is actually issue with the pm2? |
Glad you worked it out. There's more info at https://sharp.pixelplumbing.com/install#linux-memory-allocator |
@lovell On my code I used the Here is the example
Thank you. |
As of sharp v0.28.0, the use of jemalloc is automatically detected and the best concurrency is set for you, so perhaps try removing all the calls to |
Thanks @lovell |
Are you using the latest version? Is the version currently in use as reported by
npm ls sharp
the same as the latest version as reported bynpm view sharp dist-tags.latest
?What are the steps to reproduce?
I'm using sharp to resize and convert an image to 1280 pixel and webp format.
I've done a research about this possible memory leak, I've tried to use
sharp.concurrency(1)
or use theLD_PRELOAD=/usr/lib/libjemalloc.so.2
but after each of image process is complete, memory was not released back.Memory use before sharp is processing the image is about 90mb-110mb, but after processing 5-8 image, the memory increase to 280mb - 310mb and did not released back.
Basically that's how I use the sharp without use
toBuffer()
function since it would make memory consumption more bigger.What is the expected behaviour?
Memory is released back after all the process is done.
Are you able to provide a minimal, standalone code sample, without other dependencies, that demonstrates this problem?
Are you able to provide a sample image that helps explain the problem?
What is the output of running
npx envinfo --binaries --system
?On development machine
On production machine
The text was updated successfully, but these errors were encountered: