Skip to content

Tune VS Code Mac user settings to reduce Remote Server memory growth #772

Description

@ppat

Status

Settings work delivered and merged in #773:

  • Fixed the inverted extensions.autoUpdate setting and added extensions.autoCheckUpdates: false
  • Extended files.watcherExclude and search.exclude with 11 new entries (.vscode-server, .linuxbrew, mise, terraform, etc.); added search.followSymlinks: false
  • Added TypeScript memory limits (typescript.tsserver.maxTsServerMemory: 2048, typescript.disableAutomaticTypeAcquisition: true)
  • Added Git tuning (git.autofetch: false, git.autoRepositoryDetection: "openEditors", git.repositoryScanMaxDepth: 1)
  • Added remote.extensionKind pinning for UI-only extensions
  • Templated remote.SSH.remotePlatform to hide personal identifiers; removed dead config
  • Added ~/.local/bash/limits.bash with ulimit -d unlimited restore (coordinates with ppat/coder memory watchdog)
  • Added coderUsername prompt to .chezmoi.toml.tmpl
  • Fixed workflow bug in .github/workflows/full-apply-test.yaml (grep -rl | xargs NUL-delimiter)

Follow-up delivered in #789, prompted by a coordinated ppat/coder change that apportions the
memory watchdog's per-role kill budgets against a 2048 MiB envelope for the whole remote VS Code
tree:

  • typescript.tsserver.maxTsServerMemoryjs/ts.tsserver.maxMemory (the old key is deprecated,
    though still honored as a fallback) and its value dropped 2048 → 768. TypeScript spawns two
    tsserver processes that both read this same setting independently, so 2048 let tsserver alone
    claim up to 4096 MiB against the 2048 MiB budget for the entire tree — the original value never
    accounted for that.
  • remote.extensionKind gained hashicorp.hcl and samuelcolvin.jinjahtml (grammar-only, no LSP
    client, no fs/child_process use — confirmed against the extensions actually installed under
    ~/.vscode-server/extensions on a live workspace).
  • On that same live workspace, confirmed by inspecting /proc/<pid>/cmdline for every VS Code
    server process: the extension host (the tree's biggest, most volatile process, 685-738 MiB PSS
    observed) and the file watcher, pty host, and JSON/Markdown/TOML language server processes all
    expose no heap-ceiling setting at all. NODE_OPTIONS would reach all of them (none pass an
    explicit --max-old-space-size), but only if set in whatever environment launches the remote
    server tree — that's the ppat/coder template, not dotfiles, and setting it globally via a
    dotfiles shell-profile export would leak the same low ceiling onto every unrelated Node process
    run in a terminal. Not implemented for that reason.
  • Not yet confirmed working end-to-end. On the same live workspace used to write fix(vscode): lower tsserver heap ceiling, pin more UI-only extensions #789 (server
    session started after fix(vscode): stop leaking PII in remotePlatform, cut remote memory/CPU overhead #773 merged), both tsserver processes were still running with the
    extension's own unconfigured default (--max-old-space-size=3072), not the 2048 fix(vscode): stop leaking PII in remotePlatform, cut remote memory/CPU overhead #773 set.
    Most likely explanation is that chezmoi apply hadn't run on the Mac since fix(vscode): stop leaking PII in remotePlatform, cut remote memory/CPU overhead #773, rather than a
    scope-routing problem — but this was never actually verified via the Settings UI's provenance
    badge on either PR. Worth doing once, since it's the only way to close out the "does this
    actually take effect" question this whole line of settings work rests on.

Outstanding

  • Remove RooVeterinaryInc.roo-cline from remote.SSH.defaultExtensions and uninstall it from
    the remote
    — blocked on Back up Roo Code conversation history on the Mac before removing the extension #770 (Mac-side conversation backup).
  • Verify js/ts.tsserver.maxMemory and remote.extensionKind actually take effect — after
    chezmoi apply + a window reload/reconnect, check Settings UI (search each key, confirm value
    and User provenance) and Help: Show Running Extensions (confirm hashicorp.hcl /
    samuelcolvin.jinjahtml run on the UI extension host). See fix(vscode): lower tsserver heap ceiling, pin more UI-only extensions #789's coverage-gap note.
  • No available lever for the extension host's own heap, short of the NODE_OPTIONS
    blast-radius problem above. If this keeps mattering, the fix likely belongs in ppat/coder
    (scoping an env var to just the remote server's process tree), not here.

Important gotcha

The new coderUsername prompt means every machine must run chezmoi init once before its next
chezmoi apply/update, or rendering will fail with map has no entry for key "coderUsername".

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions