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

v1.27.10: compilation hangs and outputs "JavaScript heap out of memory" #3279

Closed
laurentpayot opened this issue Dec 11, 2019 · 7 comments · Fixed by #3280
Closed

v1.27.10: compilation hangs and outputs "JavaScript heap out of memory" #3279

laurentpayot opened this issue Dec 11, 2019 · 7 comments · Fixed by #3280

Comments

@laurentpayot
Copy link

laurentpayot commented Dec 11, 2019

  • Rollup Version: 1.27.10
  • Operating System (or Browser): Ubuntu 19.10 with 16GB of RAM
  • Node Version: 12.13.1

How Do We Reproduce?

  • update from v1.27.9 to v1.27.10
  • start compiling (I'm using rollup-plugin-replace, rollup-plugin-node-resolve, rollup-plugin-typescript2, rollup-plugin-terser)

Expected Behavior

Compilation completes without GC logs nor JS stacktrace.

Actual Behavior

Compilation hangs and outputs the following lines:

<--- Last few GCs --->

[21137:0x30f7ca0]    95446 ms: Mark-sweep 2116.8 (2120.6) -> 2116.8 (2120.6) MB, 470.5 / 0.0 ms  (average mu = 0.193, current mu = 0.000) last resort GC in old space requested
[21137:0x30f7ca0]    95916 ms: Mark-sweep 2116.8 (2120.6) -> 2116.8 (2120.6) MB, 469.1 / 0.0 ms  (average mu = 0.112, current mu = 0.000) last resort GC in old space requested


<--- JS stacktrace --->

==== JS stack trace =========================================

    0: ExitFrame [pc: 0x1374fd9]
Security context: 0x2af2bcb008a1 <JSObject>
    1: push [0x2af2bcb11079](this=0x1fe1aa39e5d1 <JSArray[33426304]>,0x20399de65169 <NodeBase map = 0x36aa742f6f31>)
    2: getReturnExpressionWhenCalledAtPath [0xdb64e61e031] [/home/laurent/projects/myproject/node_modules/rollup/dist/rollup.js:~6515] [pc=0x23ef9feda86d](this=0x2a8db60cb2b1 <NodeBase map = 0x36aa742f8241>,0x21b057e8ff59 <JSArray[2]>,0x2c64d4ec8...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: 0x9da7c0 node::Abort() [node]
 2: 0x9db976 node::OnFatalError(char const*, char const*) [node]
 3: 0xb39f1e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
 4: 0xb3a299 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
 5: 0xce5635  [node]
 6: 0xcf54fd v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [node]
 7: 0xcbca78 v8::internal::Factory::NewUninitializedFixedArray(int, v8::internal::AllocationType) [node]
 8: 0xe26f31  [node]
 9: 0xe3f6f2  [node]
10: 0xe3f96b  [node]
11: 0xe8c522 v8::internal::JSObject::AddDataElement(v8::internal::Handle<v8::internal::JSObject>, unsigned int, v8::internal::Handle<v8::internal::Object>, v8::internal::PropertyAttributes) [node]
12: 0xed8d1a v8::internal::Object::AddDataProperty(v8::internal::LookupIterator*, v8::internal::Handle<v8::internal::Object>, v8::internal::PropertyAttributes, v8::Maybe<v8::internal::ShouldThrow>, v8::internal::StoreOrigin) [node]
13: 0xed9a57 v8::internal::Object::SetProperty(v8::internal::LookupIterator*, v8::internal::Handle<v8::internal::Object>, v8::internal::StoreOrigin, v8::Maybe<v8::internal::ShouldThrow>) [node]
14: 0x1009ce4 v8::internal::Runtime::SetObjectProperty(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, v8::internal::StoreOrigin, v8::Maybe<v8::internal::ShouldThrow>) [node]
15: 0x100b40a v8::internal::Runtime_SetKeyedProperty(int, unsigned long*, v8::internal::Isolate*) [node]
16: 0x1374fd9  [node]
@laurentpayot laurentpayot changed the title v1.27.10: compilation hangs and outputs CG logs and JS stacktrace v1.27.10: compilation hangs and outputs "JavaScript heap out of memory" Dec 11, 2019
@lukastaegert
Copy link
Member

Sorry, will probably not be able to roll back today. You can probably fix it by pinning the version to 1.27.9. However it would be much more important for me to find out what I overlooked. It must be related to some code snippet. I would be highly interested if anyone can find a reproduction or share a repo that fails so that I can figure this out.

@xkam
Copy link

xkam commented Dec 11, 2019

I'm having the same issue with 1.27.10 (Win7, Node 8.9.4) - pinning the version to 1.27.9 goes back to normal.

@Laincito
Copy link

Laincito commented Dec 11, 2019

Same problem with firebase/auth library:

firebase/firebase-js-sdk#2431

  • Operating System version: Windows 10
  • Browser version: Any
  • Firebase SDK version: 7.5.2
  • Firebase Product: auth

Rollup 1.27.10 fails to build firebase/auth

When trying to build with the latest rollup version we get a memory error:

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

Steps to reproduce:

Relevant Code:

packaje.json:

{
  "name": "firebaseauth",
  "version": "1.0.0",
  "scripts": {
    "build": "rollup -c"
  },
  "dependencies": {
    "firebase": "^7.5.2"
  },
  "devDependencies": {
    "rollup": "1.27.10",
    "rollup-plugin-node-resolve": "^5.2.0"
  }
}

index.js:

import '@firebase/auth';

rollup.config.js:

import resolve from 'rollup-plugin-node-resolve';

export default {
    input : "index.js",
    output : {
        dir : "public",
        format: "es",
        entryFileNames: '[name]'
    },
    plugins: [
        resolve()
    ]
};

$ npm install
$ npm run build

@lukastaegert
Copy link
Member

Thanks for the reproduction, fix at #3280

@neuronetio
Copy link

this problem still exists in 2.28.1

@christiaangoossens
Copy link

christiaangoossens commented Jul 1, 2021

Similar issue still seems to exist in 2.52.6. This was for compiling node scripts with the fastify library. No amount of heap space helped. Solved by reverting to 2.48

@lukastaegert
Copy link
Member

Probably not this exact one. Please provide a reproduction and open a new issue. Also try increasing the Node heap first via the --max-old-space-size Node option, Rollup unfortunately can need a lot of memory.

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

Successfully merging a pull request may close this issue.

6 participants