Skip to content

fix: prevent OOM crash from file indexing on large projects#2801

Open
abose wants to merge 1 commit intomainfrom
ai
Open

fix: prevent OOM crash from file indexing on large projects#2801
abose wants to merge 1 commit intomainfrom
ai

Conversation

@abose
Copy link
Copy Markdown
Member

@abose abose commented Apr 8, 2026

Add two safeguards to prevent Electron crashes when opening projects with many large or binary files:

  1. Content-based binary detection: check first 8KB for null bytes (same heuristic as git/grep) to skip binary files that lack a recognized extension. Previously only extension-based detection was used, missing extensionless binary files entirely.

  2. Configurable cache size limit (default 1GB via maxFileCacheSizeMB preference): stops indexing and shows a warning toast when the limit is reached, disabling Find in Files for that project. The V8 heap limit is ~4GB per process and the web worker has its own heap, so 1GB leaves safe headroom.

Add two safeguards to prevent Electron crashes when opening projects
with many large or binary files:

1. Content-based binary detection: check first 8KB for null bytes
   (same heuristic as git/grep) to skip binary files that lack a
   recognized extension. Previously only extension-based detection
   was used, missing extensionless binary files entirely.

2. Configurable cache size limit (default 1GB via maxFileCacheSizeMB
   preference): stops indexing and shows a warning toast when the
   limit is reached, disabling Find in Files for that project.
   The V8 heap limit is ~4GB per process and the web worker has
   its own heap, so 1GB leaves safe headroom.
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 8, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant