compodoc not generating graph due to the memory issue

1k Views Asked by At

Running command 'npm run compodoc' and saw this issue:

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 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.

Does anybody know how to correctly increase the memory size here to make it work? Right now, it generates documentation of the components but not for the routes (guess this is related to the mem issue with the graph generation)

1

There are 1 best solutions below

0
On

Have you tried this snippet below

node --max_old_space_size=8192 node_modules/.bin/compodoc -p ./tsconfig.json -t --config compodoc.json

I have defined a compodoc json file where most of the configurations have been added to it.

FYI

  • node --max-old-space-size=1024 <...> #increase to 1gb
  • node --max-old-space-size=2048 <...> #increase to 2gb
  • node --max-old-space-size=3072 <...> #increase to 3gb
  • node --max-old-space-size=4096 <...> #increase to 4gb
  • node --max-old-space-size=5120 <...> #increase to 5gb
  • node --max-old-space-size=6144 <...> #increase to 6gb
  • node --max-old-space-size=7168 <...> #increase to 7gb
  • node --max-old-space-size=8192 <...> #increase to 8gb

Hope this helps.