You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looking at your config, you've given TypeDoc a setup which will result in it creating 33 ts.Programs in order to run. Unfortunately, each of these is very expensive to create, and with TypeDoc's current architecture, it needs all of them in order to start running (See also: #1606)
Building TypeDoc's docs (a single ts.Program) takes ~330mb, so your memory usage sounds about right.
If your monorepo can be compiled with a tsconfig.json that doesn't use project references to refer to a bunch of other tsconfig.json files, that should save a lot on time but isn't feasible for many projects...
Search terms
Expected Behavior
Uses less memory
Actual Behavior
Uses too much memory
Steps to reproduce the bug
We have a project that has ~110k TypeScript LoC across 700 files and 46 packages, which takes excessive amount of memory to build typedoc docs.
git clone git@github.com:deepkit/deepkit-framework.git
cd deepkit-framework
npm install
./node_modules/.bin/lerna bootstrap --ignore @deepkit/benchmark
npm run link
./node_modules/.bin/tsc --build tsconfig.json
npm install typedoc
time node --max-old-space-size=12096 ./node_modules/.bin/typedoc packages/*/index.ts
To get it to work you have to increase old-space-size to something like 12GB, otherwise you get
JavaScript heap out of memory
.After a while (to be precise 4:30 on M1 Max) and a substantial amount (~12GB) of memory used it generates the docs.
Is there anything wrong with our code base where we can improve typedoc generation time?
Environment
The text was updated successfully, but these errors were encountered: