[BUG] Error on Generation: Cannot enlarge memory arrays
See original GitHub issueOverview of the issue
When running
compodoc src -p tsconfig.json --theme readthedocs -d doc
i’m getting the following error message:
[17:44:47] Process page : coverage
[17:44:47] Copy main resources
[17:44:47] Process main graph
Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value 16777216, (2) compile with -s ALLOW_MEMORY_GROWTH=1 which adjusts the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY t
o a higher value before the program runs, or if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0
...
[17:44:49] Error during graph generation: : abort("Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value 16777216, (2) compile with -s ALLOW_MEMORY_GROWTH=1 which adjusts the size at runtime but prevent
s some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ") at Error
at Error (native)
at Ga (C:\projects\my\node_modules\viz.js\viz.js:49:124)
at Fa (C:\projects\my\node_modules\viz.js\viz.js:49:22)
at v (C:\projects\my\node_modules\viz.js\viz.js:1183:101)
at Function.n.ba [as Wa] (C:\projects\my\node_modules\viz.js\viz.js:34:488)
at uc (C:\projects\my\node_modules\viz.js\viz.js:1103:161)
at eQ (C:\projects\my\node_modules\viz.js\viz.js:1168:7157)
at zz (C:\projects\my\node_modules\viz.js\viz.js:1160:92650)
at yz (C:\projects\my\node_modules\viz.js\viz.js:1160:92582)
at AG (C:\projects\my\node_modules\viz.js\viz.js:1161:139465)
Size of my project (from overview)
52 modules 117 components 6 directives 28 injectables 5 pipes 71 classes 116 interfaces
Operating System, Node.js, npm, compodoc version(s)
Error appears in compodoc 0.39-0.41, it still worked on 0.38.
Angular configuration, a package.json
file in the root folder
"dependencies": {
"@angular/common": "2.4.7",
"@angular/compiler": "2.4.7",
"@angular/core": "2.4.7",
"@angular/forms": "2.4.7",
"@angular/http": "2.4.7",
"@angular/platform-browser": "2.4.7",
"@angular/platform-browser-dynamic": "2.4.7",
"@angular/platform-server": "2.4.7",
"@angular/router": "3.4.7",
"@angularclass/hmr": "~1.2.2",
"@angularclass/hmr-loader": "~3.0.2",
"@ngrx/core": "^1.2.0",
"@ngrx/effects": "^2.0.0",
"@ngrx/router-store": "^1.2.5",
"@ngrx/store": "^2.2.1",
"@ngrx/store-devtools": "^3.2.3",
"angular2-google-maps": "^0.17.0",
"bootstrap-datepicker": "^1.6.4",
"bootstrap-select": "^1.12.2",
"bootstrap-tooltip": "^3.1.1",
"slick-carousel": "^1.6.0",
"@ngx-translate/core": "6.0.0-beta.1",
"jquery": "^3.1.1",
"lodash": "^4.17.4",
"moment": "^2.17.1",
"core-js": "^2.4.1",
"http-server": "^0.9.0",
"ie-shim": "^0.1.0",
"immutability-helper": "^2.1.1",
"rxjs": "5.1.0",
"zone.js": "~0.7.6"
},
"devDependencies": {
"@angular/benchpress": "^0.1.0",
"@angular/compiler-cli": "2.4.7",
"@types/hammerjs": "^2.0.34",
"@types/jasmine": "^2.5.41",
"@types/jquery": "^2.0.40",
"@types/lodash": "^4.14.52",
"@types/node": "^7.0.5",
"@types/selenium-webdriver": "2.53.39",
"@types/slick-carousel": "^1.6.31",
"@types/source-map": "^0.5.0",
"@types/uglify-js": "^2.6.28",
"@types/webpack": "^2.2.5",
"angular2-template-loader": "0.6.2",
"autoprefixer": "^6.7.2",
"awesome-typescript-loader": "^3.0.4-rc.0",
"codelyzer": "^2.0.0",
"compodoc": "0.0.41",
"compression": "^1.6.2",
"css-loader": "^0.26.1",
"deep-freeze-strict": "^1.1.1",
"errorhandler": "^1.5.0",
"exports-loader": "^0.6.3",
"expose-loader": "^0.7.1",
"express": "^4.14.1",
"extract-text-webpack-plugin": "~2.0.0-beta.4",
"file-loader": "^0.10.0",
"imports-loader": "^0.7.0",
"invariant": "^2.2.2",
"istanbul-instrumenter-loader": "^2.0.0",
"json-loader": "^0.5.4",
"jsonschema": "^1.1.1",
"karma": "^1.4.1",
"karma-chrome-launcher": "^2.0.0",
"karma-coverage": "^1.1.1",
"karma-jasmine": "^1.1.0",
"karma-mocha-reporter": "^2.2.2",
"karma-phantomjs-launcher": "^1.0.2",
"karma-remap-coverage": "^0.1.4",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "2.0.2",
"less": "^2.7.2",
"less-loader": "^2.2.3",
"ng-router-loader": "^2.1.0",
"ngc-webpack": "1.2.0",
"ngrx-store-freeze": "^0.1.6",
"node-sass": "^4.5.0",
"nodemon": "^1.11.0",
"npm-run-all": "^4.0.1",
"open": "0.0.5",
"optimize-js-plugin": "0.0.4",
"parse5": "^3.0.1",
"postcss-loader": "^1.2.2",
"protractor": "^5.1.1",
"raw-loader": "0.5.1",
"reflect-metadata": "^0.1.9",
"request": "^2.79.0",
"rimraf": "^2.5.4",
"sass-loader": "^5.0.1",
"source-map-loader": "^0.1.6",
"string-replace-loader": "1.0.5",
"style-loader": "^0.13.1",
"to-string-loader": "^1.1.5",
"ts-helpers": "1.1.2",
"ts-node": "^2.1.0",
"tslint": "^4.4.2",
"tslint-loader": "^3.3.0",
"twig": "^0.10.3",
"typedoc": "^0.5.5",
"typescript": "2.1.6",
"typescript-json-schema": "^0.9.0",
"url-loader": "^0.5.7",
"webpack": "^2.2.1",
"webpack-bundle-analyzer": "^2.2.3",
"webpack-dev-middleware": "1.10.0",
"webpack-dev-server": "2.3.0",
"webpack-dll-bundles-plugin": "^1.0.0-beta.5",
"webpack-merge": "2.6.1"
},
Compodoc installed globally or locally ?
locally
Motivation for or Use Case
The graphs are not generated.
Reproduce the error
The best way to reproduce this error would be to auto generate a few hundred of each type of modules, components, directives, injectables, pipes, classes, and interfaces to see the graph generation scale (or rather fail)
Suggest a Fix
I guess the problem is that I have many modules with little hierarchy because i want them to be reusable. So the graph becomes very wide which I guess trips up the generation. Also the big overview is not nice to look at because of that.
Maybe a good fix would be to detect this scenario and skip the generation of the big overall graph and concentrate on the smaller useful ones.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:7
- Comments:6 (2 by maintainers)
Top GitHub Comments
@davidenke This issue relies on viz.js which is used by an internal module, https://github.com/compodoc/ngd, for rendering a static svg of the graph. With very huge project, viz.js fails, even you increase ALLOW_MEMORY_GROWTH. I will start moving to a d3.js client side rendering of the graph, which i hope will help visualize huge graph. I have closed the issue because now Compodoc catch this issue, and doesn’t break. Watch this issue for stuff concerning client side rendering : https://github.com/compodoc/compodoc/issues/234
Sorry, but why has this been closed? A huge advantage of compodoc is the visualization of module relations especially in large projects. @vogloblinsky Couldn’t it be resolved by enabling this mysterious
ALLOW_MEMORY_GROWTH
?