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

Out of memory #65

Open
lslocum opened this issue Mar 4, 2019 · 6 comments
Open

Out of memory #65

lslocum opened this issue Mar 4, 2019 · 6 comments

Comments

@lslocum
Copy link

lslocum commented Mar 4, 2019

I have a large app I am trying to migrate from Angular 5 to 6 and then to 7. When I try to run rxjs-5-to-6-migrate -p src/tsconfig.app.json I get FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory. I tried running it with node --max-old-space-size=8192 C:\Users\myName\AppData\Roaming\npm\node_modules\rxjs-tslint\rxjs-5-to-6-migrate.js -p src/tsconfig.app.json and I still get the same error. It seems to "run out of memory" in a matter of seconds, so I suspect there is something else going on. Any help would be appreciated. Thanks!

Package.json

  "dependencies": {
    "@angular/animations": "~7.2.0",
    "@angular/common": "~7.2.0",
    "@angular/compiler": "~7.2.0",
    "@angular/core": "~7.2.0",
    "@angular/forms": "~7.2.0",
    "@angular/platform-browser": "~7.2.0",
    "@angular/platform-browser-dynamic": "~7.2.0",
    "@angular/router": "~7.2.0",
    "@clr/angular": "^0.11.8",
    "@clr/icons": "^0.11.8",
    "@clr/ui": "^0.11.8",
    "@ng-bootstrap/ng-bootstrap": "1.0.1",
    "@ngrx/store": "^5.2.0",
    "@progress/kendo-angular-buttons": "3.0.4",
    "@progress/kendo-angular-charts": "2.0.3",
    "@progress/kendo-angular-dateinputs": "2.2.0",
    "@progress/kendo-angular-dialog": "3.2.0",
    "@progress/kendo-angular-dropdowns": "2.1.0",
    "@progress/kendo-angular-excel-export": "1.0.7",
    "@progress/kendo-angular-grid": "2.1.2",
    "@progress/kendo-angular-inputs": "2.2.0",
    "@progress/kendo-angular-intl": "1.3.2",
    "@progress/kendo-angular-l10n": "1.0.7",
    "@progress/kendo-angular-layout": "2.1.1",
    "@progress/kendo-angular-popup": "2.0.2",
    "@progress/kendo-angular-resize-sensor": "3.0.2",
    "@progress/kendo-angular-sortable": "1.0.8",
    "@progress/kendo-angular-treeview": "2.1.3",
    "@progress/kendo-angular-upload": "3.0.3",
    "@progress/kendo-data-query": "1.2.0",
    "@progress/kendo-drawing": "1.5.1",
    "@progress/kendo-theme-default": "2.48.1",
    "@telerik/kendo-intl": "1.4.0",
    "@webcomponents/custom-elements": "^1.0.8",
    "angular2-hotkeys": "^2.1.2",
    "bootstrap": "3.3.7",
    "classlist.js": "1.1.20150312",
    "core-js": "^2.5.4",
    "font-awesome": "4.7.0",
    "hammerjs": "2.0.8",
    "jquery": "3.3.1",
    "linq": "3.0.9",
    "moment": "^2.22.2",
    "primeng": "^7.0.0-beta.1",
    "rxjs": "~6.3.3",
    "ts-helpers": "1.1.2",
    "tslib": "^1.9.0",
    "tui-editor": "^1.3.0",
    "web-animations-js": "^2.3.1",
    "zone.js": "~0.8.26"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.13.0",
    "@angular/cli": "~7.3.4",
    "@angular/compiler-cli": "~7.2.0",
    "@angular/language-service": "~7.2.0",
    "@compodoc/compodoc": "^1.1.9",
    "@types/bootstrap": "^3.3.38",
    "@types/jest": "^23.3.1",
    "@types/jquery": "^3.3.0",
    "@types/kendo-ui": "^2018.1.1",
    "@types/node": "~8.9.4",
    "babel-core": "^6.26.3",
    "codelyzer": "~4.5.0",
    "htmlhint": "^0.11.0",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "jest": "^23.5.0",
    "jest-coverage-badges": "^1.1.2",
    "jest-preset-angular": "^6.0.2",
    "karma": "~4.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~1.1.2",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.4.0",
    "rxjs-tslint": "~0.1.7",
    "ts-helpers": "1.1.2",
    "ts-node": "~7.0.0",
    "tslint": "~5.11.0",
    "typemoq": "^2.1.0",
    "typescript": "~3.2.2"
  }
}
@tjfryan
Copy link

tjfryan commented Mar 5, 2019

I'm running into a similar issue. It seems that the migration script shells out to tslint so increasing the memory limit for the script itself doesn't do anything as tslint's memory limit is what needs to be increased.

@tjfryan
Copy link

tjfryan commented Mar 5, 2019

As a workaround, I've cloned the repo, ran npm run release. Went into the dist folder. Ran npm install, then modified 'rxjs-5-to-6-migrate.js' so that it runs tslint via node --max-old-space-size=8192 "node_modules/.bin/tslint" <rest of args> and will let it run with a larger memory limit. Then run the script via <path_to_cloned_repo>/dist/bin/rxjs-5-to-6-migrate -p tsconfig.json. I'm in the middle of running the script and it's gotten further than it did before.

@lslocum
Copy link
Author

lslocum commented Mar 5, 2019

Thanks @tjfryan I don't see where tslint is being used in the rxjs-5-to-5-migrate.js file. What line are you adding this node memory increase?

@tjfryan
Copy link

tjfryan commented Mar 5, 2019

In the file, there is a line that is constructing a shell command from a string. I've changed it to the following:

var command =
    'node --max-old-space-size=8192 ' +
    '"' + path_1.join(__dirname, 'node_modules', '.bin', 'tslint') + '"' +
    ' -c ' +
    '"' + path_1.join(__dirname, 'rxjs-5-to-6-migrate.json') + '"' +
    ' -p ' +
    '"' + optimist_1.argv.p + '"' +
    ' --fix';

@Weerasinghe066
Copy link

Is there any solution to this problem.

@Weerasinghe066
Copy link

@tjfryan can you explain little more clearly please.

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

No branches or pull requests

3 participants