lerna import out of memory

Created on 13 Aug 2019  路  1Comment  路  Source: lerna/lerna

Expected Behavior


import should not run out of memory

Current Behavior


import runs out of memory

terminal output

lerna import --flatten ../payments-common
lerna notice cli v3.16.4
lerna info About to import 135 commits from ../payments-common into packages/payments-common
? Are you sure you want to import these commits onto the current branch? Yes
lerna info 845c011
lerna info c40c496
lerna info 4342c30
lerna info 7e3abe7
lerna info 3260cb1
lerna info db631d5
lerna info 4e667b8
lerna info 78db178
lerna info 8843a5d
lerna info f0840f4
lerna info 8b7c0d2
lerna info 321ed4b
lerna info 38df2d0
lerna info aefaa25
lerna info 8ecec86
lerna info db3249f
lerna info a246a3b
lerna info 254f860
lerna info 2d84d64
lerna info 9677cc3
lerna info 94e6544
lerna info a1a3d20
lerna info 77e0fa8
lerna info 6b773b7
lerna info d1c80cd
lerna info 88f5208
lerna info 8f829d8
lerna info 01bd78e
lerna info 7a4c52c
lerna info c91e7d9
lerna info 70dc28a
lerna info 4488637
lerna info 36f8e92
lerna info b1c699a

<--- Last few GCs --->

[98634:0x102801600]    34085 ms: Mark-sweep 803.7 (811.7) -> 803.7 (811.7) MB, 18.7 / 0.0 ms  allocation failure GC in old space requested
[98634:0x102801600]    34105 ms: Mark-sweep 803.7 (811.7) -> 803.6 (809.7) MB, 19.6 / 0.0 ms  last resort GC in old space requested
[98634:0x102801600]    34119 ms: Mark-sweep 803.6 (809.7) -> 803.6 (809.7) MB, 14.3 / 0.0 ms  last resort GC in old space requested


<--- JS stacktrace --->

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

Security context: 0x3e0c4dc258b9 <JSObject>
    2: replace(this=0x3e0ceb0a0ec1 <Very long string[412478734]>,0x3e0ceb0a0951 <JSRegExp <String[23]: ^([-+]{3} COMPARE_[AB])>>,0x3e0ceb0a0f21 <String[27]: $1/packages/payments-common>)
    3: createPatchForCommit [/Users/dylan/coin-payments/node_modules/@lerna/import/index.js:192] [bytecode=0x3e0cf2ec9e41 offset=232](this=0x3e0c346ea3d1 <Command map = 0x3e0c98477ec9>,sha=0x3e0c...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [/Users/dylan/.nvm/versions/node/v8.15.0/bin/node]
 2: node::FatalException(v8::Isolate*, v8::Local<v8::Value>, v8::Local<v8::Message>) [/Users/dylan/.nvm/versions/node/v8.15.0/bin/node]
 3: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [/Users/dylan/.nvm/versions/node/v8.15.0/bin/node]
 4: v8::internal::Factory::NewRawTwoByteString(int, v8::internal::PretenureFlag) [/Users/dylan/.nvm/versions/node/v8.15.0/bin/node]
 5: v8::internal::String::SlowFlatten(v8::internal::Handle<v8::internal::ConsString>, v8::internal::PretenureFlag) [/Users/dylan/.nvm/versions/node/v8.15.0/bin/node]
 6: v8::internal::Runtime_RegExpReplace(int, v8::internal::Object**, v8::internal::Isolate*) [/Users/dylan/.nvm/versions/node/v8.15.0/bin/node]
 7: 0x21b9287042fd
 8: 0x21b92876b535
 9: 0x21b9287688a0
10: 0x21b9287bedb6
Abort trap: 6

Possible Solution


Steps to Reproduce (for bugs)


  1. git clone [email protected]:go-faast/coin-payments.git
  2. git clone [email protected]:go-faast/payments-common.git
  3. cd coin-payments
  4. npm install
  5. lerna import --flatten ../payments-common

lerna.json


{
  "packages": [
    "packages/*"
  ],
  "version": "0.0.0",
  "command": {
    "publish": {
      "ignoreChanges": [
        "test/**/*",
        "bin/**/*",
        "prettier.config.js",
        "rollup.config.js",
        "*.md",
        "lint-staged.config.js",
        ".huskyrc.js",
        "jest.config.js",
        "typedoc.js",
        "tslint.json",
        ".editorconfig"
      ]
    }
  }
}

Context



Cannot import repo to new lerna project

Your Environment

| Executable | Version |
| ---: | :--- |
| lerna --version | 3.16.4 |
| npm --version | 6.10.1 |
| yarn --version | 1.13.0 |
| node --version | v8.15.0 |

| OS | Version |
| --- | --- |
| macOS Sierra | 10.12.6 |

Most helpful comment

I had the same issue. Using max-old-space-size fixed it.

node --max-old-space-size=8000 ./node_modules/.bin/lerna import ../payments-common --flatten

>All comments

I had the same issue. Using max-old-space-size fixed it.

node --max-old-space-size=8000 ./node_modules/.bin/lerna import ../payments-common --flatten

Was this page helpful?
0 / 5 - 0 ratings