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

Heap out of memory when bundling #728

Open
sayzenberg opened this issue Apr 24, 2020 · 0 comments
Open

Heap out of memory when bundling #728

sayzenberg opened this issue Apr 24, 2020 · 0 comments
Labels

Comments

@sayzenberg
Copy link

Environment

"@haul-bundler/preset-0.60": "0.18.0",
"@haul-bundler/cli": "0.19.0",
"@haul-bundler/core": "0.19.0",
"react": "16.9.0",
"react-native": "0.61.5",

Description

I'm migrating our app from using the legacy version of Haul to the new one, and running into an issue while bundling our app, where it always seems to run out of memory on the heap unless I pass a larger max-old-space-size value to Node. Is there a good way to figure out why this is happening?

C:\Repos\foo\packages\app>node C:\Repos\foo\node_modules\@haul-bundler\cli\bin\cli.js multi-bundle --config C:\Repos\foo\packages\app\haul.config.js --platform windows --minify true --dev false --assets-dest dist/windows/ship --progress none --skip-host-check
info ▶︎ Haul is now compiling index bundle in production mode

info ▶︎ Assets Destination: C:\Repos\foo\packages\app\dist\windows\ship
info ▶︎ Bundle output: index.windows.bundle
info ▶︎ Bundle output (resolved): C:\Repos\foo\packages\app\dist\windows\ship\index.windows.bundle
info ▶︎ Starting from:
       C:\Repos\foo\node_modules\react-native\Libraries\polyfills\console.js
       C:\Repos\foo\node_modules\react-native\Libraries\polyfills\error-guard.js
       C:\Repos\foo\node_modules\react-native\Libraries\polyfills\Object.es7.js
       C:\Repos\foo\node_modules\react-native-windows\Libraries\Core\InitializeCore.js
       C:\Repos\foo\packages\app\src\index

<--- Last few GCs --->

[18612:000002D09299FBA0]   171865 ms: Mark-sweep 1060.1 (1292.2) -> 1060.1 (1272.2) MB, 263.6 / 0.0 ms  (average mu = 0.284, current mu = 0.000) last resort GC in old space requested
[18612:000002D09299FBA0]   172119 ms: Mark-sweep 1060.1 (1272.2) -> 1060.1 (1252.7) MB, 254.5 / 0.0 ms  (average mu = 0.165, current mu = 0.000) last resort GC in old space requested


<--- JS stacktrace --->

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

    0: ExitFrame [pc: 000000F5C6B5C5C1]
Security context: 0x00e3ae21e6e9 <JSObject>
    1: _send [00000285F84311D9] [internal/child_process.js:736] [bytecode=0000036CE536EEF1 offset=660](this=0x02894467f991 <ChildProcess map = 000003BCC4FB1279>,message=0x008509d4ed71 <JSArray[4]>,handle=0x01adde9826f1 <undefined>,options=0x008509d4edf9 <Object map = 000003BCC4FB1011>,callback=0x01adde9826f1 <undefined>)
    2: send [00000285F8431199] [int...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: 00007FF690A2C6AA v8::internal::GCIdleTimeHandler::GCIdleTimeHandler+4506
 2: 00007FF690A07416 node::MakeCallback+4534
 3: 00007FF690A07D90 node_module_register+2032
 4: 00007FF690D2189E v8::internal::FatalProcessOutOfMemory+846
 5: 00007FF690D217CF v8::internal::FatalProcessOutOfMemory+639
 6: 00007FF690F07F94 v8::internal::Heap::MaxHeapGrowingFactor+9620
 7: 00007FF690F0645B v8::internal::Heap::MaxHeapGrowingFactor+2651
 8: 00007FF6910302BB v8::internal::Factory::AllocateRawWithImmortalMap+59
 9: 00007FF691032D6D v8::internal::Factory::NewRawTwoByteString+77
10: 00007FF690D7DDA8 v8::internal::Smi::SmiPrint+536
11: 00007FF690D14EAB v8::internal::StringHasher::UpdateIndex+219
12: 00007FF690D3A2C6 v8::String::Utf8Length+22
13: 00007FF690958C47 v8::internal::LookupIterator::index+37463
14: 00007FF690954F83 v8::internal::LookupIterator::index+21907
15: 00007FF69095192A v8::internal::LookupIterator::index+7994
16: 00007FF690F34382 std::vector<v8::internal::compiler::MoveOperands * __ptr64,v8::internal::ZoneAllocator<v8::internal::compiler::MoveOperands * __ptr64> >::_Umove+79442
17: 00007FF690F3580D std::vector<v8::internal::compiler::MoveOperands * __ptr64,v8::internal::ZoneAllocator<v8::internal::compiler::MoveOperands * __ptr64> >::_Umove+84701
18: 00007FF690F34866 std::vector<v8::internal::compiler::MoveOperands * __ptr64,v8::internal::ZoneAllocator<v8::internal::compiler::MoveOperands * __ptr64> >::_Umove+80694
19: 00007FF690F3474B std::vector<v8::internal::compiler::MoveOperands * __ptr64,v8::internal::ZoneAllocator<v8::internal::compiler::MoveOperands * __ptr64> >::_Umove+80411
20: 000000F5C6B5C5C1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant