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

Out-of-memory error #3

Closed
ehmicky opened this issue May 21, 2020 · 10 comments · Fixed by #4
Closed

Out-of-memory error #3

ehmicky opened this issue May 21, 2020 · 10 comments · Fixed by #4
Labels
bug Something isn't working

Comments

@ehmicky
Copy link

ehmicky commented May 21, 2020

Some builds are crashing due to running out of memory:

<--- Last few GCs --->
[15157:0x2872030] 70768 ms: Scavenge 1374.6 (1424.2) -> 1373.9 (1424.2) MB, 3.8 / 0.0 ms (average mu = 0.106, current mu = 0.032) allocation failure
[15157:0x2872030] 70778 ms: Scavenge 1374.8 (1424.2) -> 1374.0 (1424.2) MB, 3.8 / 0.0 ms (average mu = 0.106, current mu = 0.032) allocation failure
[15157:0x2872030] 70788 ms: Scavenge 1374.9 (1424.2) -> 1374.2 (1424.7) MB, 4.2 / 0.0 ms (average mu = 0.106, current mu = 0.032) allocation failure
<--- JS stacktrace --->
==== JS stack trace =========================================
0: ExitFrame [pc: 0x2cd14995be1d]
1: StubFrame [pc: 0x2cd14994e6d6]
Security context: 0x036476b9e6c1 <JSObject>
2: replace [0x36476b905c1](this=0x21171492ca99 <String[20]: .qc-guide-box:before>,0x23a2b15d84a1 <JSRegExp <String[59]: :?:before|:?:after|:?:visited|:?:first-letter|:?:first-line>>,0x2fc6142029f1 <String[0]: >)
3: enter [0x3dafe7c7d1d9] [/opt/build/repo/node_modules/penthouse/lib/selectors-profile.js:~96] [pc=0x...
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 0x8fb090 node::Abort() [/opt/buildhome/.nvm/versions/node/v10.20.1/bin/node]
2: 0x8fb0dc [/opt/buildhome/.nvm/versions/node/v10.20.1/bin/node]
3: 0xb031ce v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/opt/buildhome/.nvm/versions/node/v10.20.1/bin/node]
4: 0xb03404 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/opt/buildhome/.nvm/versions/node/v10.20.1/bin/node]
5: 0xef7462 [/opt/buildhome/.nvm/versions/node/v10.20.1/bin/node]
6: 0xef7568 v8::internal::Heap::CheckIneffectiveMarkCompact(unsigned long, double) [/opt/buildhome/.nvm/versions/node/v10.20.1/bin/node]
7: 0xf03642 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/opt/buildhome/.nvm/versions/node/v10.20.1/bin/node]
8: 0xf03f74 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/opt/buildhome/.nvm/versions/node/v10.20.1/bin/node]
9: 0xf06be1 v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [/opt/buildhome/.nvm/versions/node/v10.20.1/bin/node]
10: 0xed0064 v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationSpace) [/opt/buildhome/.nvm/versions/node/v10.20.1/bin/node]
11: 0x11701ee v8::internal::Runtime_AllocateInNewSpace(int, v8::internal::Object**, v8::internal::Isolate*) [/opt/buildhome/.nvm/versions/node/v10.20.1/bin/node]
12: 0x2cd14995be1d

Do you know where this might come from?

@Tom-Bonnike
Copy link
Owner

Tom-Bonnike commented May 22, 2020

Awww I was worried about this, it probably happens on websites with a lot of pages, I probably need to make sure I don’t run critical more than X times at once :(

See here, should be straightforward:
https://github.com/Tom-Bonnike/netlify-plugin-inline-critical-css/blob/master/index.js#L21-L36

I think the max listener thing is not such a big issue, but since it runs concurrently, I think it’s definitely what’s causing the issue. I’ll look into using https://github.com/rxaviers/async-pool

@Tom-Bonnike
Copy link
Owner

Tom-Bonnike commented May 22, 2020

See https://github.com/Tom-Bonnike/netlify-plugin-inline-critical-css/pull/4/files @ehmicky, I’ll test this locally on my own project but it’s not big enough to get this issue :/ Hope a limit of 4 is good, I might need to adjust it later if it still happens.

@Tom-Bonnike
Copy link
Owner

Just published 1.0.4, please let me know if the error still happens, I’ll decrease to a max concurrency of 2.

@Tom-Bonnike
Copy link
Owner

@ehmicky should I update the version in the plugins.json on the netlify/plugins repo?

@ehmicky
Copy link
Author

ehmicky commented May 22, 2020

Hi @Tom-Bonnike, yes thanks! I will approve it right away :)
However making the version go live still require a manual process from us at the moment. We are currently working on automating the process.

@Tom-Bonnike
Copy link
Owner

Did you notice more similar errors in the last days? :)

@ehmicky
Copy link
Author

ehmicky commented May 26, 2020

No! :)

@Tom-Bonnike
Copy link
Owner

I’ll close for now, we can re-open if it starts showing up again, might just be because few people are using it atm 😄

@ehmicky
Copy link
Author

ehmicky commented May 29, 2020

It looks like this is still happening:

┌────────────────────────────────────────────────────────────────┐
│ 4. onPostBuild command from netlify-plugin-inline-critical-css │
└────────────────────────────────────────────────────────────────┘

<--- Last few GCs --->
[1393:0x488ec30] 114467 ms: Mark-sweep 2044.6 (2058.2) -> 2044.5 (2058.2) MB, 56.5 / 0.0 ms (average mu = 0.104, current mu = 0.000) last resort GC in old space requested
[1393:0x488ec30] 114546 ms: Mark-sweep 2044.5 (2058.2) -> 2044.5 (2058.2) MB, 78.8 / 0.1 ms (average mu = 0.050, current mu = 0.000) last resort GC in old space requested
<--- JS stacktrace --->
==== JS stack trace =========================================
0: ExitFrame [pc: 0x13c5b79]
1: StubFrame [pc: 0x1402bb0]
Security context: 0x3a80b2c808d1 <JSObject>
2: replace [0x3a80b2c963d9](this=0x18d95fa40119 <Very long string[253132]>,0x110fc4fb6921 <JSRegExp <String[#20]: (<head(?:\\s[^>]*)?>)>>,0x110fc4fbaf31 <String[17]: $1<style></style>>)
3: preparePenthouseData(aka preparePenthouseData) [0x26b1cd429061] [/opt/buildhome/.netlify-build-plugins/node_modules/critical/src/file.js...
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
1: 0xa09830 node::Abort() [/opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/bin/node]
2: 0xa09c55 node::OnFatalError(char const*, char const*) [/opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/bin/node]
3: 0xb7d71e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/bin/node]
4: 0xb7da99 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/bin/node]
5: 0xd2a1f5 [/opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/bin/node]
6: 0xd3ab08 v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/bin/node]
7: 0xd08fad v8::internal::Factory::NewRawTwoByteString(int, v8::internal::AllocationType) [/opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/bin/node]
8: 0x10c08f4 v8::internal::ReplacementStringBuilder::ToString() [/opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/bin/node]
9: 0x106fabb [/opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/bin/node]
10: 0x1070c7a v8::internal::Runtime_RegExpReplaceRT(int, unsigned long*, v8::internal::Isolate*) [/opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/bin/node]
11: 0x13c5b79 [/opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/bin/node]

This is using netlify-plugin-inline-critical-css@1.0.4.
The repository is private. The plugin was using the default inputs.
This is all the information that this build is showing unfortunately.

@Tom-Bonnike
Copy link
Owner

Tom-Bonnike commented May 29, 2020

I think i’ll just stop running critical concurrently, might also fix #5, at the cost of a slower execution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants