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 have a script in which I'm running magick::image_read on a large number of images in sequence and then immediately discarding the result (the objective is just to verify that it's a valid image that can be read by magick). However, even though each result is discarded, I'm still getting "cache resources exhausted" after a while. I determined that running gc() every 100 or so images seems to prevent this error, so my assumption is that ImageMagick's cache is filling up with images that are no longer referenced but have not yet been garbage collected. Obviously, manually triggering gc every N iterations is a workaround, not a true fix. Is there any way to fix this a bit more elegantly? For example, could image_read check for this error and then trigger gc and try one more time before throwing the error for real?
The text was updated successfully, but these errors were encountered:
I have a script in which I'm running
magick::image_read
on a large number of images in sequence and then immediately discarding the result (the objective is just to verify that it's a valid image that can be read by magick). However, even though each result is discarded, I'm still getting "cache resources exhausted" after a while. I determined that runninggc()
every 100 or so images seems to prevent this error, so my assumption is that ImageMagick's cache is filling up with images that are no longer referenced but have not yet been garbage collected. Obviously, manually triggering gc every N iterations is a workaround, not a true fix. Is there any way to fix this a bit more elegantly? For example, couldimage_read
check for this error and then trigger gc and try one more time before throwing the error for real?The text was updated successfully, but these errors were encountered: