mui / toolpad

Toolpad: Full stack components and low-code builder for dashboards and internal apps.
https://mui.com/toolpad/
MIT License
1.27k stars 282 forks source link

circleci test_static consumes OOM #1101

Closed Janpot closed 2 years ago

Janpot commented 2 years ago

Current behavior 😯

Regularly seeing test_static circleci jobs fail because of OOM issues.

example: https://app.circleci.com/pipelines/github/mui/mui-toolpad/3578/workflows/b14c82c8-b004-45c1-b1ca-5a30412b6154/jobs/13481

@mui/toolpad-app: [build:*next] Killed
@mui/toolpad-app: [build:*next] error Command failed with exit code 137.
@mui/toolpad-app: [build:*next] info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
@mui/toolpad-app: [build:*next] yarn run build:next exited with code 137

Insights confirmed an increase in max memory consumption since Sept 30

Screenshot 2022-10-06 at 10 07 03

Might be caused by https://github.com/mui/mui-toolpad/pull/1043. I'm putting my money on the source map changes 🙂

We were already quite close to 100%, so if we can't bring memory consumption down, scaling the instance may be in order.

bytasv commented 2 years ago

Do we currently also generate sourcemaps when running out tests? Wondering if we could easily test the assumption about sourcemaps impact by opening PR where we disable sourcemaps generation and comparing with the one that has it enabled? 🤔

Janpot commented 2 years ago

Maybe, but the sourcemaps are an integral part of the Sentry setup. I just mentioned it as I've seen big memory usage differences with different webpack devtool settings

apedroferreira commented 2 years ago

Let's not upload sourcemaps automatically and do it manually instead, should be ok for us to do it. Hopefully that will help.

Janpot commented 2 years ago

I believe it'll be sourcemap generation that will be heavy, not the uploading. And we'll need to generate good sourcemaps for sentry, regardless of whether we're uploading them

apedroferreira commented 2 years ago

I believe it'll be sourcemap generation that will be heavy, not the uploading

Yep I expressed myself a bit wrong, if it's Sentry that's generating them during the build and we can skip that it should be fine. Got it, so seems like we need to generate the source maps in any case now that we use Sentry...

bytasv commented 2 years ago

Sentry should not be generating sourcemaps, it should only upload them, our build is suppose to generate sourcemaps, so that would mean disabling sourcemaps for our build

Janpot commented 2 years ago

Sentry should not be generating sourcemaps, it should only upload them, our build is suppose to generate sourcemaps, so that would mean disabling sourcemaps for our build

The sentry plugin wraps the next.js config and alters it to so that our build generates sourcemaps in production and then it uploads them at the end of the build.

I think what we could do is: