Skip to content

JavaScript heap out of memory #3740

@erikerikson

Description

@erikerikson

This is a Bug Report

Description

Endless recursive file loading exceeds process memory limits.

When trying to remove the serverless.yml here:
https://github.com/Nordstrom/hello-retail/tree/master/web

With the command (STAGE is properly defined and references an existing stack):

../node_modules/.bin/sls remove -s $STAGE -v
  • What went wrong?
<--- Last few GCs --->

[22378:0x102804600]   192582 ms: Mark-sweep 1484.5 (1567.0) -> 1484.5 (1567.0) MB, 2065.8 / 0.0 ms  allocation failure GC in old space requested
[22378:0x102804600]   194638 ms: Mark-sweep 1484.5 (1567.0) -> 1484.4 (1536.0) MB, 2056.4 / 0.0 ms  last resort gc 
[22378:0x102804600]   196780 ms: Mark-sweep 1484.4 (1536.0) -> 1484.4 (1536.0) MB, 2141.0 / 0.0 ms  last resort gc 


<--- JS stacktrace --->

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

    2: arguments adaptor frame: 1->2
Security context: 0x90122ec0d31 <JS Object>
    3: _settlePromiseFromHandler [<src-root>/hello-retail/node_modules/serverless/node_modules/bluebird/js/release/promise.js:~496] [pc=0x20e01cfbd1f3](this=0x2d4a7d8ea59 <a Promise with map 0x17140f73cc21>,handler=0x2d4a7d97671 <JS Function getValueFromSource.then.valueToPopulate (SharedFunctionInfo 0x2b325a77f011)>,receiver=0x90122e04311 <undefined>,val...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [~/.nvm/versions/node/v7.2.0/bin/node]
 2: node::FatalException(v8::Isolate*, v8::Local<v8::Value>, v8::Local<v8::Message>) [~/.nvm/versions/node/v7.2.0/bin/node]
 3: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [~/.nvm/versions/node/v7.2.0/bin/node]
 4: v8::internal::Factory::NewByteArray(int, v8::internal::PretenureFlag) [~/.nvm/versions/node/v7.2.0/bin/node]
 5: v8::internal::SourcePositionTableBuilder::ToSourcePositionTable(v8::internal::Isolate*, v8::internal::Handle<v8::internal::AbstractCode>) [~/.nvm/versions/node/v7.2.0/bin/node]
 6: v8::internal::FullCodeGenerator::MakeCode(v8::internal::CompilationInfo*) [~/.nvm/versions/node/v7.2.0/bin/node]
 7: v8::internal::(anonymous namespace)::GenerateUnoptimizedCode(v8::internal::CompilationInfo*) [~/.nvm/versions/node/v7.2.0/bin/node]
 8: v8::internal::(anonymous namespace)::GetUnoptimizedCode(v8::internal::CompilationInfo*) [~/.nvm/versions/node/v7.2.0/bin/node]
 9: v8::internal::Compiler::Compile(v8::internal::Handle<v8::internal::JSFunction>, v8::internal::Compiler::ClearExceptionFlag) [~/.nvm/versions/node/v7.2.0/bin/node]
10: v8::internal::Runtime_CompileLazy(int, v8::internal::Object**, v8::internal::Isolate*) [~/.nvm/versions/node/v7.2.0/bin/node]
11: 0x20e01ca063a7
12: 0x20e01ca0675a
13: 0x20e01ca07e55
14: 0x20e01cfbd1f3
15: 0x20e01cfe1eb4
Abort trap: 6
  • What did you expect should have happened?

Expected: removal of stack

Downgrading to serverless@1.11.0 allowed this to proceed as expected.

  • What was the config you used?

https://github.com/Nordstrom/hello-retail/blob/master/web/serverless.yml

  • What stacktrace or error message from your provider did you see?

see above.

Additional Data

I suspect that this change may have introduced the new behavior but am not certain:
971a279#diff-b921cbcedd2151d24391fb39acb84adeR88

  • Serverless Framework Version you're using: 1.13.2, 1.14.0
  • Operating System: osx
  • Stack Trace: see above
  • Provider Error messages: n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions