Lazy loading and resource management
Nothing heavy starts until a user action needs it, and nothing stays alive longer than a documented policy allows.
Language services
A service is shared by every compatible document while it runs; "idle" means it has no documents. Failure to start covers a missing binary, an initialisation error and the 60 s initialisation timeout.
- Opening a folder starts no language server.
- Opening a document identifies its language and parses it (syntax is available at once).
- A server starts only for a trusted folder, a file inside it, and a server the profile allows.
- One service runs per (workspace root, server id); every compatible document shares it. Ten Rust tabs use one rust-analyzer.
- A TypeScript document cannot start rust-analyzer; different languages use different services.
- When a service has no documents, it keeps running for the profile's
idle_grace_seconds(30 s generic, 300 s rust) so quick close/reopen does not restart it. Then it receivesshutdown/exit. max_running_servicesis a soft cap: when reached, the longest-idle service is stopped first. Services with open documents are never stopped to satisfy the cap.- Text buffers belong to the core. Stopping, crashing or restarting a service never touches unsaved text; on restart, open documents are re-sent with their current contents.
These policies come from the active profile. Tests in crates/ide-languages/tests/lsp_lifecycle.rs cover sharing, grace-period reuse, eviction, missing servers, crash restarts and restart limits.
Syntax analysis limits
Measurements showed that a Tree-sitter tree uses about 40 bytes per source byte and that re-parsing very large flat files can take tens of milliseconds (see performance). So:
| Limit | Value | Effect |
|---|---|---|
| Syntax size limit | 1 MiB | Larger files open as plain text; the status bar says why. |
| Keystroke reparse budget | 6 ms | A slower reparse is stopped; the previous tree (shifted by the edit) keeps highlighting usable. |
| Deferred reparse | next frame without input | Highlighting catches up as soon as typing pauses. |
| Open-time parse budget | 500 ms | Pathological input cannot freeze the window. |
Lifting the 1 MiB limit requires background or viewport-limited parsing; it is on the backlog.
Other bounded resources
| Resource | Bound |
|---|---|
| Explorer | One directory per expansion; 5 000 entries per directory shown. |
| Documents | 64 MiB per file; undo history 10 000 steps. |
| Decorations | Visible lines only; 2 000 per provider; lines over 4 096 chars skipped. |
| Rendering | Visible lines only; 10 000 chars per line drawn. |
| Server stderr | Last 40 lines. |
| AI context | 16 000 chars of selection. |
| Extensions | 256 per directory, 256 KiB manifests, 64 contributions per kind. |
Measuring
The status bar shows PSS (or RSS) of the IDE plus all child processes on Linux. axiom-perf and axiom --perf-idle-memory report the same per process; see benchmarking.