Skip to content

Add section in readme about OOM issues #270

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,34 @@ src lsif upload -github-token='${{ secrets.GITHUB_TOKEN }}' -no-progress
For more examples, see the
[Sourcegraph docs](https://docs.sourcegraph.com/code_intelligence/how-to/index_a_typescript_and_javascript_repository).

### Dealing with out of memory issues (OOM)

You may experience OOM issues when indexing large codebases

```
<--- JS stacktrace --->

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
1: 0xb7b150 node::Abort() [node]
2: 0xa8c89a [node]
3: 0xd62ea0 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
4: 0xd63247 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
5: 0xf40945 [node]
6: 0xf52e2d v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
...
```

To fix this problem, try one of the following steps:

- Add `--no-global-caches` to the index command like this `scip-typescript
index --no-global-caches REST_OF_THE_COMMAND`. By default, scip-typescript
caches symbol indexing across TypeScript projects to speed up indexing. This
cache increases the memory footprint, which can cause OOM. Disabling this cache
slows down indexing but reduces the memory footprint.
- Increase memory to the Node.js process by running scip-typescript like this
`node --max-old-space-size=16000 "$(which scip-typescript)" index REST_OF_COMMAND`.
Replace 16000 with an even larger number if your computer has bigger RAM.

## Migrating from lsif-node

Before creating scip-typescript, we used another TypeScript indexer called
Expand Down