You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Good day.
I was working in a project where I was doing some manipulation of several jpegs in a loop and I noticed that the unmanage memory seems to build up when I call the JpegsaveStream function on each. Deposing and closing the Image object doesn't seem to help. I am profiling using "dotMemory" and I can see that the unmanaged memory jumps up to about 2Gb for about 2K images. Is there something that I am missing where I can clean this up? I am loading, manipulating and saving one image at a time:
var image = Image.JpegloadStream(imageStream, null, true);
//do manupulation (hue, saturation, etc...)
image.JpegsaveStream(stream); //This is what seems to do it as if I just load and comment out this line the issue doesn't present
image.Dispose();
image.Close();
Any hints would be appreciated. Thanks.
The text was updated successfully, but these errors were encountered:
Nevermind, figured out I needed to be more aggressive in managing the scopes and made use of the OnPostClose method(adding delegate to dispose) to keep the memory consumption down.
Sorry, this dropped off my radar. Glad to hear you found a solution to this.
You can also check this kind of "leaks" by setting the VIPS_LEAK environment variable or by doing NetVips.Leak = true; within NetVips - see: #114 (comment). If you procress untrusted images, you might also be interested in these tips: #96 (comment).
Good day.
I was working in a project where I was doing some manipulation of several jpegs in a loop and I noticed that the unmanage memory seems to build up when I call the JpegsaveStream function on each. Deposing and closing the Image object doesn't seem to help. I am profiling using "dotMemory" and I can see that the unmanaged memory jumps up to about 2Gb for about 2K images. Is there something that I am missing where I can clean this up? I am loading, manipulating and saving one image at a time:
var image = Image.JpegloadStream(imageStream, null, true);
//do manupulation (hue, saturation, etc...)
image.JpegsaveStream(stream); //This is what seems to do it as if I just load and comment out this line the issue doesn't present
image.Dispose();
image.Close();
Any hints would be appreciated. Thanks.
The text was updated successfully, but these errors were encountered: