Closed RamonBalthazar closed 4 years ago
I am running into the exact same issue. I tried adding NODE_OPTIONS=--max_old_space_size=4096
and messing with GATSBY_CPU_COUNT
but no luck.
Same over here :( Netlify is taking eons to do my images too (over 15 minutes) so I figured I'd go the CircleCI -> Firebase route.
Can we skip Generating image thumbnails — 4454/4454 - 1130.272 s
?
Is thumbnails here = all images?
It should regenerate only the modified ones.
It should regenerate only the modified ones.
Since CircleCI doesn't keep the .cache
directory around (where the images are stored during consecutive builds e.g. locally) you'll re-generate all images.
Was getting this exact issue, turns out we had a accidentally had a 4.5mb png that, when processed by sharp, pushed the memory limits of the circleci “free” tier. Scaling the image down solved the problem.
Hiya!
This issue has gone quiet. Spooky quiet. 👻
We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!
Thanks for being a part of the Gatsby community! 💪💜
I have the same issue on CircleCI.
...
[] 810/1462 136.8 s 55% Generating image thumbnails [] 812/1462 136.8 s 55% Generating image thumbnails [] 814/1462 136.8 s 55% Generating image thumbnails
[] 816/1462 142.1 s 55% Generating image thumbnails [] 836/1462 142.1 s 57% Generating image thumbnails
[] 837/1462 142.3 s 57% Generating image thumbnails [] 841/1462 142.5 s 57% Generating image thumbnails
error UNHANDLED EXCEPTION spawn ENOMEM
Error: spawn ENOMEM
- child_process.js:366 ChildProcess.spawn
internal/child_process.js:366:11
...
Hey again!
It’s been 30 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it.
Please keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m HUMAN_EMOTION_SORRY
. Please feel free to reopen this issue or create a new one if you need anything else.
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!
Thanks again for being part of the Gatsby community!
Hi! Thank you so much for this great gatsby community! I really love it!
We do have a small project using Gatsby, of course! We do use CircleCI as well, and we have exactly the same problems described here. I will attach a screenshot as well.
I think, handling large images should not be a problem at all - to run into spawn ENOMEM is really a very tough questions. Isn't it @LekoArts ?
It would be great to resolve those problems, a lot of us are experiencing. Many many thanks!
P.S. Here we go...
If the problem is in libvips, then perhaps setting this environment variable to 1? https://github.com/libvips/libvips/blob/master/libvips/iofuncs/threadpool.c#L304
libvips/iofuncs/threadpool.c:304
$ node sharp.js
8
$ VIPS_CONCURRENCY=1 node sharp.js
1
where sharp.js contains:
const sharp = require('sharp');
console.log(sharp.concurrency());
We were using a small resource (1 core) in CircleCI which meant that having 8 workers caused sporadic not enough memory issues. We saw built times improvements after this change too, likely to less resource contention.
I hope it helps people facing this issue in the future and avoids unnecessary bigger build machines.
Credits to @dylansmith
Description
In CircleCI during the build process while generating image thumbnails, the console "freezes" and after some time a memory leak message is displayed:
My main suspicion is that something is not respecting the
GATSBY_CPU_COUNT=2
environment variable so the workers can't balance themselves, probably Image Sharp?Steps to reproduce
The issue is happening in CircleCI for a private repo, any idea on what and how I could share more information about it?
Expected result
The build shouldn't be crashing.
We do have loads of images and some are pretty heavy, but I don't think the build should ever crash, only take longer to process them all. At least that's what happens locally and that's what I expect to be happening in CircleCI.
Actual result
It starts generating the thumbnails but fails right in the middle of it due to a memory leak.
Environment
The environment in CircleCI: