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

Process killed with out of memory error when enabling image screenshot downsizing #337

Open
kevin-brotcke opened this issue Oct 19, 2023 · 3 comments

Comments

@kevin-brotcke
Copy link
Contributor

kevin-brotcke commented Oct 19, 2023

We have thousands (2532 last run) of screenshots in our reports so the disk size was pretty large (3.48 GB). I enabled -z param to compress screenshots to 25% of their original size and it worked on a small sample but crashes on our full nightly test run. Memory continuously keeps getting eaten and I saw it go up >100 GBs of RAM until it finally gets forced killed with out of memory error status code 137.

Current workaround I found was to leave off the image resize param and instead resize it manually after with imagemagick (install with brew install imagemagick) which uses hardly any memory when running (< 100 MB):

magick mogrify -resize 25% *.jpeg

May be related: #230
Version: 2.3.4

I'm not able to share my exact Xcode report to use as a test case.

@kevin-brotcke
Copy link
Contributor Author

Ended up going with

magick mogrify -quality 60% -resize 25% -sampling-factor 4:2:0 -strip -interlace JPEG -colorspace sRGB *.jpeg

Based on https://developers.google.com/speed/docs/insights/OptimizeImages

@kevin-brotcke
Copy link
Contributor Author

kevin-brotcke commented Nov 10, 2023

Actually that ended up failing sometimes too because we would hit max CLI length. Final working version:

for screenshot in $(find TestResults -name '*.jpeg'); do
  magick mogrify -quality 60% -resize 25% -sampling-factor 4:2:0 -strip -interlace JPEG -colorspace sRGB $screenshot
done

@vakhidbetrakhmadov
Copy link

vakhidbetrakhmadov commented Feb 21, 2024

➕ facing the same issue

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