Skip to content
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

cache resources exhausted Error #366

Open
asitemade4u opened this issue Feb 10, 2023 · 4 comments
Open

cache resources exhausted Error #366

asitemade4u opened this issue Feb 10, 2023 · 4 comments

Comments

@asitemade4u
Copy link

asitemade4u commented Feb 10, 2023

  • I am using the magick package, among other things, to watermark images in batch.
  • The R environment from which magick is called is a rocker docker container, itself called by Drone CI.

Drone CI -> rocker container -> magick

  • I have mapped, within the rocker container, the magick tmp folder to a folder on the host where there is plenty of space.
  • I also have changed the /etc/ImageMagick6/policy.xml file within the rocker container to accommodate more memory (8 GB) and set the Magick tmp folder to the folder mapped above.

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
Copy link
Author

asitemade4u commented Feb 10, 2023

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
Copy link
Author

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

@jeroen
Copy link
Member

jeroen commented Feb 10, 2023

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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants