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
I'm mot expert but as web going to support 4k and HIDPI more and more.we need higher resolution image .It would be better if we change algorythm to use stream or buffer for biger size images
I don't use BlurHash, but have the similar problem - huge memory leak when using imagecolorat() function. I call imagecolorat() for each pixel of the image (via two nested cycles, as at code example at first message) - it's required for my business logic process.
I process many images in cycle at one process, and I call imagedestroy() after finish of each image processing, but unfortunately memory still leaked.
If I comment line with imagecolorat() calling memory leak is disappear. So I think that after calling imagedestroy() memory, used for store result of the imagecolorat() work, still full of data and not purged until php-process was not finished or killed.
I have no idea what we can to do with that.
Added a little bit later:
When you are using unset, the memory will only be freed whenever garbage collector decides, but when you are setting a variable to a different value (null in this case), then you might get some memory freed of course with the cost of CPU.
So, I tried change my code from imagedestroy($resource) to $resource = null and memory leak was gone.
I hope this will be useful to someone.
I have 10 MB image so when i use PHP implementation, 12 GB of memory get max and kills the process
thsi is class
The text was updated successfully, but these errors were encountered: