ropensci / magick

Magic, madness, heaven, sin
https://docs.ropensci.org/magick
Other
461 stars 66 forks source link

cache resources exhausted Error #366

Open asitemade4u opened 1 year ago

asitemade4u commented 1 year ago

Drone CI -> rocker container -> magick

Nevertheless, after a certain amount of treated images, I get the cache resources exhausted error and the process stops abruptly.

Any idea on how I can overcome the limitations and go through the process?

Thx, S.

asitemade4u commented 1 year ago

Here is the exact error message, as reported by R through Drone CI:

Error: R: cache resources exhausted `/mnt/stp/53a3fe8a467ddd70108a7e660362a29d/brooklyn-heights-0028.jpg' @ error/cache.c/OpenPixelCache/4095
asitemade4u commented 1 year ago

I have tried to reduce the number of threads as per #346 and it did not work either.

jeroen commented 1 year ago

Yes imagemagick uses a lot of memory. You can try calling gc() to force a cleanup (although R should do this automatically every now and then), or explicitly call image_destroy(img) to free memory of images that you no longer need.

asitemade4u commented 1 year ago

THANKS @jeroen , gc() seems to work fine -- I could treat the batch that was not working previously. I will try with an even larger number of images and let you know.