@@ -68,6 +68,34 @@ src lsif upload -github-token='${{ secrets.GITHUB_TOKEN }}' -no-progress
6868For more examples, see the
6969[ Sourcegraph docs] ( https://docs.sourcegraph.com/code_intelligence/how-to/index_a_typescript_and_javascript_repository ) .
7070
71+ ### Dealing with out of memory issues (OOM)
72+
73+ You may experience OOM issues when indexing large codebases
74+
75+ ```
76+ <--- JS stacktrace --->
77+
78+ FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
79+ 1: 0xb7b150 node::Abort() [node]
80+ 2: 0xa8c89a [node]
81+ 3: 0xd62ea0 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
82+ 4: 0xd63247 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
83+ 5: 0xf40945 [node]
84+ 6: 0xf52e2d v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
85+ ...
86+ ```
87+
88+ To fix this problem, try one of the following steps:
89+
90+ - Add ` --no-global-caches ` to the index command like this `scip-typescript
91+ index --no-global-caches REST_OF_THE_COMMAND`. By default, scip-typescript
92+ caches symbol indexing across TypeScript projects to speed up indexing. This
93+ cache increases the memory footprint, which can cause OOM. Disabling this cache
94+ slows down indexing but reduces the memory footprint.
95+ - Increase memory to the Node.js process by running scip-typescript like this
96+ ` node --max-old-space-size=16000 "$(which scip-typescript)" index REST_OF_COMMAND ` .
97+ Replace 16000 with an even larger number if your computer has bigger RAM.
98+
7199## Migrating from lsif-node
72100
73101Before creating scip-typescript, we used another TypeScript indexer called
0 commit comments