question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Continue to have issues with Cannot Enlarge Memory Arrays

See original GitHub issue
Overview of the issue

Hello,

So I’ve been all over the web, here in gitlab and still no solution. I’m a 58 year old programmer with over 35 years experience. Here’s my issue(s);

… [14:59:05] Process module graph: ScreeningModule [14:59:05] Process module graph: ScreeningRoutingModule [14:59:05] Process module graph: ScreenshotModule [14:59:06] Process module graph: SearchModule [14:59:06] Process module graph: SearchRoutingModule [14:59:06] Process module graph: SharedModule

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 allows increasing the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or (4) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0

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 allows increasing the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or (4) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0

[14:59:06] 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 allows increasing the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or (4) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 "). Build with -s ASSERTIONS=1 for more info.

Operating System, Node.js, npm, compodoc version(s)

Windows 10 pro npm info using npm@6.4.1 npm info using node@v8.11.1

Angular configuration, a package.json file in the root folder

{ “name”: “new-enrollment”, “version”: “0.0.0”, “license”: “MIT”, “scripts”: { “ng”: “ng”, “doc:build”: “compodoc -p tsconfig.json”, “doc:serve”: “compodoc -s”, “doc:buildandserve”: “compodoc -p tsconfig.json -s”, “reports:doc”: “node ./tools/scripts/compodoc.js”, “start”: “ng serve”, “build”: “ng build”, “test”: “ng test”, “lint”: “ng lint”, “e2e”: “ng e2e”, “gulp”: “gulp” }, “private”: true, “dependencies”: { “@agm/core”: “^1.0.0-beta.3”, “@angular/animations”: “^5.2.7”, “@angular/cdk”: “5.2.4”, “@angular/common”: “^5.2.7”, “@angular/compiler”: “^5.2.7”, “@angular/core”: “^5.2.7”, “@angular/forms”: “^5.2.7”, “@angular/http”: “^5.2.7”, “@angular/material”: “^5.2.5”, “@angular/platform-browser”: “^5.2.7”, “@angular/platform-browser-dynamic”: “^5.2.7”, “@angular/platform-server”: “^5.2.7”, “@angular/router”: “^5.2.7”, “@ng-bootstrap/ng-bootstrap”: “2.0.0”, “@ng-select/ng-select”: “2.4.2”, “@ngrx/effects”: “5.2.0”, “@ngrx/entity”: “^5.2.0”, “@ngrx/store”: “5.2.0”, “@ngrx/store-devtools”: “5.2.0”, “@ngui/datetime-picker”: “^0.16.2”, “@tensorflow/tfjs”: “^0.13.0”, “@types/animejs”: “^2.0.0”, “@types/cropperjs”: “^1.1.3”, “@types/fabric”: “^1.5.43”, “@types/html2canvas”: “0.5.32”, “@types/jspdf”: “1.1.31”, “addstyles”: “^1.0.5”, “angular-bootstrap-affix”: “^0.2.4”, “angular-froala-wysiwyg”: “^2.8.1”, “angular-mentions”: “^0.8.0”, “angular-split”: “^1.0.4”, “angular-svg-round-progressbar”: “^1.2.1”, “angular-tag-cloud-module”: “^2.4.0”, “angular2-busy”: “https://github.com/Sky4CE/angular2-busy/tarball/static-template”, “angular2-draggable”: “^1.4.2”, “angular2-google-maps”: “0.17.0”, “angular2-highcharts”: “^0.5.5”, “angular2-hotkeys”: “^2.0.4”, “angular2-mentions”: “^0.7.3”, “angular2-moment”: “^1.9.0”, “animejs”: “^2.2.0”, “aos”: “^3.0.0-beta.6”, “base64-img”: “^1.0.4”, “bodybuilder”: “2.2.15”, “bootstrap”: “^3.3.7”, “cache-loader”: “1.2.2”, “child_process”: “^1.0.2”, “classlist.js”: “^1.1.20150312”, “core-js”: “^2.4.1”, “cors-anywhere”: “^0.4.1”, “cropperjs”: “^1.4.1”, “curl”: “^0.1.4”, “dom-to-image”: “^2.6.0”, “elasticsearch”: “15.1.1”, “fabric”: “^2.3.6”, “ffmpeg”: “0.0.4”, “font-awesome”: “^4.7.0”, “gulp-version-append”: “0.2.0”, “hammerjs”: “^2.0.8”, “highcharts”: “6.0.7”, “html2canvas”: “1.0.0-alpha.12”, “imagemagick”: “^0.1.3”, “jquery”: “^3.2.1”, “jspdf”: "1.3.5 ", “lemmatizer”: “^ 0.0.1”, “lodash”: “^4.17.10”, “ng-multiselect-dropdown”: “^0.1.9”, “ng2-archwizard”: “^2.1.0”, “ng2-bootstrap-modal”: “https://github.com/Sky4CE/ng2-bootstrap-modal/tarball/v.1.0.2”, “ng2-bs3-modal”: “^0.10.4”, “ng2-ckeditor”: “1.1.9”, “ng2-completer”: “^1.5.2”, “ng2-file-upload”: “^1.2.1”, “ng2-inputmask”: “^0.2.5”, “ng2-ion-range-slider”: “2.0.0”, “ng2-select”: “^1.2.0”, “ng2-split-pane”: “^1.4.0”, “ng2-stomp-service”: “^1.2.2”, “ng2-ui”: “^0.14.1”, “ng2-validation”: “^4.2.0”, “ng4-popover”: “^1.0.23”, “ng5-slider”: “^1.1.3”, “ngx-bootstrap”: “^2.0.5”, “ngx-cookie”: “^2.0.1”, “ngx-editor”: “^3.3.0”, “ngx-highlight”: “0.0.3”, “ngx-logger”: “^3.1.0”, “ngx-masonry”: “^1.1.2”, “ngx-perfect-scrollbar”: “^5.3.3”, “ngx-toastr”: “^6.3.0”, “ngx-virtual-scroller”: “1.0.4”, “ngx-webcam”: “0.2.0”, “ngx-wow”: “^1.0.2”, “nlcst-parse-english”: “^1.1.2”, “nlcst-pattern-match”: “^1.3.4”, “npm”: “^5.6.0”, “path”: “0.12.7”, “pluralize”: “^7.0.0”, “popover”: “^2.4.1”, “pos”: “^0.4.2”, “primeng”: “6.1.7”, “rxjs”: “^5.5.6”, “simplengrams”: “^0.1.2”, “slick-carousel”: “^1.6.0”, “sockjs-client”: “^1.1.4”, “stompjs”: “^2.3.3”, “stopword”: “^0.1.9”, “style-loader”: “^0.23.1”, “underscore”: “^1.8.3”, “unoconv”: “^0.1.2”, “web-animations-js”: “^2.3.1”, “webui-popover”: “^1.2.18”, “zone.js”: “^0.8.4” }, “devDependencies”: { “@angular/cli”: “^1.7.4”, “@angular/compiler-cli”: “^5.2.7”, “@angular/language-service”: “^4.0.0”, “@compodoc/compodoc”: “^1.1.2”, “@types/googlemaps”: “3.29.0”, “@types/jasmine”: “2.5.45”, “@types/node”: “^6.0.108”, “angular-ide”: “^0.9.44”, “codelyzer”: “^3.0.1”, “gulp”: “4.0.0”, “jasmine-core”: “^2.6.2”, “jasmine-spec-reporter”: “^4.1.0”, “karma”: “^1.7.0”, “karma-chrome-launcher”: “^2.1.1”, “karma-cli”: “^1.0.1”, “karma-coverage-istanbul-reporter”: “^1.4.2”, “karma-jasmine”: “^1.1.2”, “karma-jasmine-html-reporter”: “^0.2.2”, “protractor”: “^5.1.2”, “ts-node”: “^3.0.4”, “tslint”: “^5.3.2”, “typescript”: “2.4.2” }, “description”: “This project was generated with Angular CLI version 1.1.3.”, “main”: “gulpfile.js”, “repository”: { “type”: “git”, “url”: “https://git.acompany/somecode.git” }, “keywords”: [], “author”: “” }

Compodoc installed globally or locally ?

BOTH!

I’m running the following in git bash window:

$ compodoc -s ALLOW_MEMORY_GROWTH=1 -p tsconfig.json -d documentation

This yields the following error:

1.1.7

Typescript version : 2.9.1

Node.js version : v8.11.1

Operating system : Windows 10

[14:59:51] No configuration file found, switching to CLI flags. [14:59:51] Provided source folder ALLOW_MEMORY_GROWTH=1 was not found in the current directory

If possible your terminal logs before the error

NA

Motivation for or Use Case

I cannot continue with COMPDOC and I desperately need to finish the documentation. This is a HUGE app

I have a large app and it fails

I’ve tried this… from this example: https://stackoverflow.com/questions/27688804/how-do-i-debug-error-spawn-enoent-on-node-js - Scroll to the accepted solution…

const {spawn} = require(‘child_process’); console.log(“spawn defined: before spawn”);

//spawn(/^win/.test(process.platform) ? ‘npm.cmd’ : ‘npm run compdoc’, // [‘-p’, ‘tsconfig.json’, ‘-d’, ‘documentation/’], { // stdio: ‘inherit’, // shell: true //});

spawn(‘npm run compdoc’, [‘-p’, ‘tsconfig.json’, ‘-d’, ‘documentation/’], { stdio: ‘inherit’, shell: true });

//const cmd = spawn(‘compdoc’, [‘-p’, ‘tsconfig.json’, ‘-d’, ‘documentation/’]);

//console.log(process.cmd); //spawn(‘Spawn Help: ‘, [’–help’]); //console.log("spawn CONSTANT: ", cmd);

//cmd.stdout.pipe(process.stdout); //cmd.stderr.pipe(process.stdout);

//(function () { // console.log(“inside function”); // //var childProcess = require(“child_process”); // var oldSpawn = cmd.spawn; // // function mySpawn() { // console.log(‘spawn called’); // console.log(arguments); // // var result = oldSpawn.apply(this, arguments); // return result; // } // // console.log(“before spawn”); // cmd.spawn = mySpawn; //})();

Related issues

Several times but not in the exact context I have…

Suggest a Fix

DAMN RIGHT, this is a “GEM” and I’ll help you contribute but you need to show where and how, STEP-BY-STEP how to increase the memory and either call COMPDOC via command line script that I wrote.

I placed it in the ROOT directory in ./tools/scripts/compdoc.js

I call it via:

node tools/scripts/compdoc.js

and get an error below…

spawn defined: before spawn npm info it worked if it ends with ok npm info using npm@6.4.1 npm info using node@v8.11.1 npm ERR! missing script: compdoc npm timing npm Completed in 185ms

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\user\AppData\Roaming\npm-cache_logs\2019-01-03T23_05_48_923Z-debug.l og

and here’s that LOG:

0 info it worked if it ends with ok 1 verbose cli [ ‘C:\Program Files\nodejs\node.exe’, 1 verbose cli ‘C:\Users\user\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js’, 1 verbose cli ‘run’, 1 verbose cli ‘compdoc’, 1 verbose cli ‘-p’, 1 verbose cli ‘tsconfig.json’, 1 verbose cli ‘-d’, 1 verbose cli ‘documentation/’ ] 2 info using npm@6.4.1 3 info using node@v8.11.1 4 verbose stack Error: missing script: compdoc 4 verbose stack at run (C:\Users\user\AppData\Roaming\npm\node_modules\npm\lib\run-script.js:155:19) 4 verbose stack at C:\Users\user\AppData\Roaming\npm\node_modules\npm\lib\run-script.js:63:5 4 verbose stack at C:\Users\user\AppData\Roaming\npm\node_modules\npm\node_modules\read-package-json\read-json.js:115:5 4 verbose stack at C:\Users\user\AppData\Roaming\npm\node_modules\npm\node_modules\read-package-json\read-json.js:418:5 4 verbose stack at checkBinReferences_ (C:\Users\user\AppData\Roaming\npm\node_modules\npm\node_modules\read-package-json\read-json.js:373:45) 4 verbose stack at final (C:\Users\user\AppData\Roaming\npm\node_modules\npm\node_modules\read-package-json\read-json.js:416:3) 4 verbose stack at then (C:\Users\user\AppData\Roaming\npm\node_modules\npm\node_modules\read-package-json\read-json.js:160:5) 4 verbose stack at C:\Users\user\AppData\Roaming\npm\node_modules\npm\node_modules\read-package-json\read-json.js:280:12 4 verbose stack at C:\Users\user\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:78:16 4 verbose stack at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:511:3) 5 verbose cwd C:\petersprojects\wwwroot\repos\kyp-frontend 6 verbose Windows_NT 10.0.16299 7 verbose argv “C:\Program Files\nodejs\node.exe” “C:\Users\user\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js” “run” “compdoc” “-p” “tsconfig.json” “-d” “documentation/” 8 verbose node v8.11.1 9 verbose npm v6.4.1 10 error missing script: compdoc 11 verbose exit [ 1, true ]

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:38 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
pborreggcommented, Feb 4, 2019

Vincent,

28 days ago you stated this:

Hi, sorry, not right now. The work on changing the graph engine is at around 75%. We will except a release this month.

We’re at 4 FEB 19… I need, respectfully, this to work with larger apps… You program ROCKS, man… I need a workaround for now or a date when you’ll have the fix to this larger problem.

Thanks Vincent

Peter

2reactions
vogloblinskycommented, Aug 4, 2019

@pborregg I am not out of business. I am just the only maintainer of this tool, with a daily job, a family… I know this issue is very confusing for users. I have a solution ready to add. I can add you inside early testers if you want. Give me some good vibes and i will try to fix this asap.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I solve this problem? "Cannot enlarge memory arrays."
"Cannot enlarge memory arrays." I have this error when I try to launch my unity game in the browser.
Read more >
WebGL Player freezes with 'Cannot enlarge memory arrays ...
WebGL Player freezes with 'Cannot enlarge memory arrays' error when the 'Standard' Shader is always included in builds.
Read more >
Cannot Enlarge Memory Arrays Browser error - Unity Forum
Hello, I created a WebGL app, and ran it in a browser, then i got the error Cannot enlarge memory arrays. Either (1)...
Read more >
Cannot enlarge memory arrays when allocating 1Mbytes buffer
If you see a difference between two browsers here, it is likely either a browser bug or a timing-related issue, as running out...
Read more >
Resolve "Out of Memory" Errors - MATLAB & Simulink
When your code operates on large amounts of data or does not use memory efficiently, MATLAB ® might produce an error in response...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found