-
Notifications
You must be signed in to change notification settings - Fork 26
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 leak and errors #149
Comments
Hi @gabrieleolmi, How is apache set up? I suppose you have fastcgi and a persistent process for requests, is that right? |
FPM/FastCGI |
Perhaps this is a symptom of https://www.php.net/manual/en/language.oop5.decon.php#105368? I tried to debug that using commit kleisauke@d20ec0d and see about 45 references still alive after the |
Huh that's a bit surprising, there shouldn't be any circular references. Does adding |
Ah, my bad. You're right, there shouldn't be any circular references. Commit kleisauke@73d05c0 fixes that, it seems we need to explicitly unset the images in |
The Hopefully that would also fix the memory leak you were seeing. |
@gabrieleolmi libvips 8.13 is out now with Kleis's linking improvement (setting https://github.com/libvips/libvips/releases Any testing would be great. |
This comment was marked as resolved.
This comment was marked as resolved.
I built libvips 8.13 from source and i did some quick tests. |
Woo! Great, thank you for doing the testing. |
Errors when calling
|
You can't use libvips again after shutdown, and you can't init again. Only call it just before process exit. |
I called |
Yes, fastcgi is a persistent process, Don't call shutdown if you use it. |
I have a server running Ubuntu 22.04 where I have apache and php installed. I have recently started using libvips for php, and I have noticed that every time a php script is run, the amount of ram used increases more and more, without being freed. I am forced to use
Vips\Config::shutDown()
at the end of the script otherwise the server ram gets saturated. I tried to useVips\Config::cacheSetMax(5)
but nothing changes (memory grows more and more).php file example:
Also sometimes libvips returns an error:
libvips42 version: 8.12.1
php-vips version: 2.0.3
The text was updated successfully, but these errors were encountered: