Skip to content

EmberApp requires defaults as first argument, otherwise: JavaScript heap out of memory #292

@backspace

Description

@backspace

Hello! I’m excited about this. I did some preliminary investigation on how much work it would be to get travis-web FastBoot-ing and I quickly ran into an error I didn’t know how to move beyond: JavaScript heap out of memory. I’ve put the error at the bottom due to weird GFM problems.

Thanks to @danmcclain and @stefanpenner in the Ember Community Slack, I was able to get past this with this commit to add defaults as the first argument for EmberApp.

I see that this is now the default in the ember-cli-build.js blueprint, so this won’t be a problem for most people. But it could be something others run into when working on this with older Ember CLI applications. @danmcclain mentioned that @arjansingh had this problem too.

Maybe it’s not worth documenting this at all, as I’m not sure how rare this kind of thing is, but at least this issue may help others who are searching for how to handle this.

Stack trace from ember fastboot --serve-assets
<--- Last few GCs --->

128427 ms: Mark-sweep 1318.9 (1404.0) -> 1318.9 (1405.0) MB, 405.0 / 0.0 ms [allocation failure] [GC in old space requested].
128891 ms: Mark-sweep 1318.9 (1405.0) -> 1318.8 (1405.0) MB, 463.7 / 0.0 ms [allocation failure] [GC in old space requested].
129587 ms: Mark-sweep 1318.8 (1405.0) -> 1326.1 (1404.0) MB, 695.6 / 0.0 ms [last resort gc].
130250 ms: Mark-sweep 1326.1 (1404.0) -> 1333.7 (1404.0) MB, 662.9 / 0.0 ms [last resort gc].

<--- JS stacktrace --->

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

Security context: 0x2343144cfb51
2: _compile [module.js:~510] [pc=0x3c9fcfb5e446] (this=0xbc0d1a7da49 <a Module with map 0x1f3b6811c3b1>,content=0x40381104201 <Very long string[648478]>,filename=0x193e69ebfc1 <String[86]: /Users/b/Documents/Travis/travis-web/bower_components/ember/ember-template-compiler.js>)
3: .js [module.js:~577] [pc=0x3c9fcfb85cb2] (this=0x326b70306391 <an Object with map 0x1f3b6811b121>,module=0xb...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
1: node::Abort() [/usr/local/opt/nvm/versions/node/v6.9.1/bin/node]
2: node::FatalException(v8::Isolate*, v8::Localv8::Value, v8::Localv8::Message) [/usr/local/opt/nvm/versions/node/v6.9.1/bin/node]
3: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [/usr/local/opt/nvm/versions/node/v6.9.1/bin/node]
4: v8::internal::Factory::NewRawTwoByteString(int, v8::internal::PretenureFlag) [/usr/local/opt/nvm/versions/node/v6.9.1/bin/node]
5: v8::internal::String::SlowFlatten(v8::internal::Handlev8::internal::ConsString, v8::internal::PretenureFlag) [/usr/local/opt/nvm/versions/node/v6.9.1/bin/node]
6: v8::internal::Parser::ParseProgram(v8::internal::Isolate*, v8::internal::ParseInfo*) [/usr/local/opt/nvm/versions/node/v6.9.1/bin/node]
7: v8::internal::Parser::Parse(v8::internal::ParseInfo*) [/usr/local/opt/nvm/versions/node/v6.9.1/bin/node]
8: v8::internal::Parser::ParseStatic(v8::internal::ParseInfo*) [/usr/local/opt/nvm/versions/node/v6.9.1/bin/node]
9: v8::internal::(anonymous namespace)::CompileToplevel(v8::internal::CompilationInfo*) [/usr/local/opt/nvm/versions/node/v6.9.1/bin/node]
10: v8::internal::Compiler::GetSharedFunctionInfoForScript(v8::internal::Handlev8::internal::String, v8::internal::Handlev8::internal::Object, int, int, v8::ScriptOriginOptions, v8::internal::Handlev8::internal::Object, v8::internal::Handlev8::internal::Context, v8::Extension*, v8::internal::ScriptData**, v8::ScriptCompiler::CompileOptions, v8::internal::NativesFlag, bool) [/usr/local/opt/nvm/versions/node/v6.9.1/bin/node]
11: v8::ScriptCompiler::CompileUnboundInternal(v8::Isolate*, v8::ScriptCompiler::Source*, v8::ScriptCompiler::CompileOptions, bool) [/usr/local/opt/nvm/versions/node/v6.9.1/bin/node]
12: node::ContextifyScript::New(v8::FunctionCallbackInfov8::Value const&) [/usr/local/opt/nvm/versions/node/v6.9.1/bin/node]
13: v8::internal::FunctionCallbackArguments::Call(void ()(v8::FunctionCallbackInfov8::Value const&)) [/usr/local/opt/nvm/versions/node/v6.9.1/bin/node]
14: v8::internal::Builtin_Impl_HandleApiCallConstruct(v8::internal::(anonymous namespace)::BuiltinArguments<(v8::internal::BuiltinExtraArguments)1>, v8::internal::Isolate
) [/usr/local/opt/nvm/versions/node/v6.9.1/bin/node]
15: v8::internal::Builtin_HandleApiCallConstruct(int, v8::internal::Object**, v8::internal::Isolate*) [/usr/local/opt/nvm/versions/node/v6.9.1/bin/node]
16: 0x3c9fc8c092a7
[1] 48705 abort ember fastboot --serve-assets

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions