wingsuit-designsystem / wingsuit

Twig for Storybook
GNU General Public License v2.0
91 stars 16 forks source link

Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory #133

Closed danleecpi closed 3 years ago

danleecpi commented 3 years ago

Describe the bug I tried installing wingsuit again from scratch in a new directory and found that running yarn dev:storybook causes the following issue. I installed this yeasterday with no problem. Reading around the error people suggest this is an issue with memory leakage or node version.

"Usually just increasing the memory allocated to Node will allow your program to run but may not actually solve the real problem and the memory used by the node process could still exceed the new memory you allocate."

To Reproduce Steps to reproduce the behavior:

  1. npx @wingsuit-designsystem/cli init

  2. cd wingsuit/

  3. yarn install

  4. yarn dev:storybook

  5. I find it gets so far and runs out of memory.

  6. I try increasing memory by running export NODE_OPTIONS="--max-old-space-size=5120" #increase to 5gb and re-run yarn dev:storybook but get no resulting change.

yarn run v1.22.10
$ start-storybook --config-dir apps/storybook
info @storybook/react v6.2.1
info 
info => Loading presets
info => Loading 1 config file in "/Users/danlee/Sites/Boilerplate/wingsuit/apps/storybook"
info => Loading 3 other files in "/Users/danlee/Sites/Boilerplate/wingsuit/apps/storybook"
info => Loading custom manager config
info => Using implicit CSS loaders
(node:10684) DeprecationWarning: Relying on the implicit PostCSS loader is deprecated and will be removed in Storybook 7.0.
If you need PostCSS, include '@storybook/addon-postcss' in your '.storybook/main.js' file.

See https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#deprecated-implicit-postcss-loader for details.
(Use `node --trace-deprecation ...` to show where the warning was created)
info => Using custom postcss.config.js
info => Using default Webpack4 setup
10% building 1/1 modules 0 activeinfo => Loading custom manager config
10% building 1/6 modules 5 active ...suit/node_modules/@storybook/addon-links/dist/esm/preset/addDecorator.js-generated-other-entry.jsℹ 「wdm」: wait until bundle finished: 
66% building 550/580 modules 30 active ...ref--8!/Users/danlee/Sites/Boilerplate/wingsuit/node_modules/object.values/implementation.js[BABEL] Note: The code generator has deoptimised the styling of /Users/danlee/Sites/Boilerplate/wingsuit/node_modules/react-dom/cjs/react-dom.development.js as it exceeds the max of 500KB.
69% building 2842/2855 modules 13 active .../danlee/Sites/Boilerplate/wingsuit/node_modules/@storybook/source-loader/extract-source.js[BABEL] Note: The code generator has deoptimised the styling of /Users/danlee/Sites/Boilerplate/wingsuit/node_modules/lodash/lodash.js as it exceeds the max of 500KB.
68% building 3256/3321 modules 65 active ...-0!/Users/danlee/Sites/Boilerplate/wingsuit/node_modules/highlight.js/lib/languages/dns.js
<--- Last few GCs --->

[10684:0x1046d4000]   108366 ms: Scavenge (reduce) 5106.8 (5125.7) -> 5106.1 (5126.7) MB, 4.3 / 0.0 ms  (average mu = 0.107, current mu = 0.005) allocation failure 
[10684:0x1046d4000]   108373 ms: Scavenge (reduce) 5106.9 (5125.7) -> 5106.7 (5126.7) MB, 5.5 / 0.0 ms  (average mu = 0.107, current mu = 0.005) allocation failure 
[10684:0x1046d4000]   108378 ms: Scavenge (reduce) 5107.1 (5128.7) -> 5106.7 (5129.5) MB, 5.3 / 0.0 ms  (average mu = 0.107, current mu = 0.005) allocation failure 

<--- JS stacktrace --->

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0x1012e4da5 node::Abort() (.cold.1) [/Users/danlee/.nvm/versions/node/v14.16.0/bin/node]
 2: 0x1000a6239 node::Abort() [/Users/danlee/.nvm/versions/node/v14.16.0/bin/node]
 3: 0x1000a639f node::OnFatalError(char const*, char const*) [/Users/danlee/.nvm/versions/node/v14.16.0/bin/node]
 4: 0x1001e9007 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/Users/danlee/.nvm/versions/node/v14.16.0/bin/node]
 5: 0x1001e8fa3 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/Users/danlee/.nvm/versions/node/v14.16.0/bin/node]
 6: 0x100397e95 v8::internal::Heap::FatalProcessOutOfMemory(char const*) [/Users/danlee/.nvm/versions/node/v14.16.0/bin/node]
 7: 0x10039995a v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [/Users/danlee/.nvm/versions/node/v14.16.0/bin/node]
 8: 0x100395029 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/Users/danlee/.nvm/versions/node/v14.16.0/bin/node]
 9: 0x1003928c1 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/Users/danlee/.nvm/versions/node/v14.16.0/bin/node]
10: 0x1003a115a v8::internal::Heap::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/Users/danlee/.nvm/versions/node/v14.16.0/bin/node]
11: 0x1003a11e1 v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/Users/danlee/.nvm/versions/node/v14.16.0/bin/node]
12: 0x10036eb87 v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/Users/danlee/.nvm/versions/node/v14.16.0/bin/node]
13: 0x1006ed8d8 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/Users/danlee/.nvm/versions/node/v14.16.0/bin/node]
14: 0x100a7a239 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit [/Users/danlee/.nvm/versions/node/v14.16.0/bin/node]
15: 0x3195999ab503 
error Command failed with signal "SIGABRT".

Expected behavior Storybook to run

Screenshots If applicable, add screenshots to help explain your problem.

Desktop:

christianwiedemann commented 3 years ago

Hi, this happens with storybook 6.2. Will provide a new version in the next hours.

christianwiedemann commented 3 years ago

in the meantime you can downgrade to storybook 6.1 if you like.

christianwiedemann commented 3 years ago

I released rc.4 and it works again. hightlight.js goes mad. I excluded it from babel. Now it works fine again. You can run 'yarn upgrade' or install it from scratch.

christianwiedemann commented 3 years ago

@danleecpi I will close this for now. Feel free to reopen if still have problems. Thanks for reporting.