Uh oh!
There was an error while loading. Please reload this page.
Ensured large image is unloaded from memory when generating previews - #22008
Conversation
kesselb
commented
Jul 27, 2020
Thanks 👍
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Phew! I think that did it. The rebase pulled in a bunch of other commits though - I hope that's okay. I should probably pull them....... back in a minute..... |
Signed-off-by: Elijah Martin-Merrill <elijah@nyp-itsours.com>
elijahnyp
commented
Jul 27, 2020
There we go, nice and clean, should be good for reviews. My apologies for the sloppy process to get to this point. |
icewind1991
left a comment
There was a problem hiding this comment.
Strange that gc doesn't trigger cleaning this up already
elijahnyp
commented
Jul 31, 2020
From what I could find, it's just the way php has handled images for years. There's something in the image libraries that keeps the resource referenced so GC doesn't see it as garbage unless the image is explicitly destroyed. |
Thanks for the solution, works well for me. I find this to be the simplest solution for this problem 👍 |
kesselb
commented
Aug 2, 2020
Yes. |
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
MorrisJobke
left a comment
There was a problem hiding this comment.
Looks good and works 👍 I pushed a commit to fix the instanceof check.
MorrisJobke
commented
Aug 5, 2020
/backport to stable19 |
MorrisJobke
commented
Aug 5, 2020
/backport to stable18 |
MorrisJobke
commented
Aug 5, 2020
/backport to stable17 |
https://php.watch/versions/8.0#imagedestroy good to know. |
Thanks for your first pull request and welcome to the community! Feel free to keep them coming! If you are looking for issues to tackle then have a look at this selection: https://github.com/nextcloud/server/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22 |
MorrisJobke
commented
Aug 11, 2020
/backport to stable18 |
MorrisJobke
commented
Aug 11, 2020
/backport to stable17 |
PR to resolve#21995
likely also resolvesnextcloud/previewgenerator#108
incorporates suggestion by @kesselb to use the destroy method of IImage instead of destroying the resource directly.
This change should be very low risk as it's destroying an image object that is only sometimes created. It's created if there isn't a cached version of the preview and it is independent of the newly generated preview image.
It has been tested on 19.0.1