-
-
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
delete sharp instance #3817
Comments
Like all JavaScript Objects in Node.js, when a |
@lovell |
You can set a JavaScript variable to var sharpInstance = sharp(...)...;
...
sharpInstance = null; |
I suspect the question you're going to ask next is about memory consumption as reported via resident set size (RSS). If so, please ensure you've read and understand everything discussed in #955 |
@lovell |
The latest sharp provides the latest version of glib that does not use GSlice. You've provided very little information in this issue, but my best guess would be that you're using a globally-installed libvips with an outdated glib dependency, or perhaps you're using Electron (e.g. electron/electron#38048). If you still require help, please create a standalone repo with minimal code that allows someone else to reproduce. |
Is there a fix for this in electron? It frequently crashes my app in development. The linked electron issue is marked as resolved, but seems unrelated to sharp in the end. sharp 0.32.6 (has been happening since at least 0.30 that we started on) |
@shamsup Sharp provides the latest glib, which no longer uses the gslice memory allocator (this is a good thing). I suspect Electron either ships with or relies on an older version of glib that does use gslice. You should be able to switch off gslice by setting the |
I faced this memory issue too in electron when i upgraded to using sharp 0.32.6. |
This is great for our development environment, thanks! Is there anything special we need to do to ensure our application runs with this flag on users' machines, or does it get locked in at build time? Is this a Linux only issue, or does it affect macOS and Windows as well? I couldn't find anything in electron's docs about this variable at all.
Unfortunately, we have experienced it with much older versions as well, but we are doing a LOT with sharp, sometimes hundreds of operations per minute. |
@shamsup |
I hope this information helped. Please feel free to re-open with more details if further assistance is required. |
Question about an existing feature
how to delete sharp instance? Does not occupy memory space
The text was updated successfully, but these errors were encountered: