microsoft / microsoft/vscode

`code --status` reports impossible process memory on macOS

Open
#331,542 0 comments 0 reactions 1 assignee Claimed by @deepak1556 View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

## Type of issue

Bug

## VS Code version

Code 1.133.0 (`a5b500951314efd502d07465bd138dfbd714a960`); current `main` is also affected.

## OS

macOS 26.5.2 arm64, 128 GiB system memory.

## Steps to reproduce

1. Start VS Code.
2. Run `code --status`.
3. Inspect the `Mem MB` column.

## Actual

The process table reports impossible values such as:

```text
CPU % Mem MB PID Process
0 360287970190 48139 code
1 1441151880759 48192 window [1]
```

The same processes report approximately 268 MiB and 1,085 MiB through `ps`.

## Cause

On non-Windows platforms, `listProcesses` already converts the `ps` memory percentage to bytes in `src/vs/base/node/ps.ts`. `DiagnosticsService.formatProcessItem` then treats that byte value as a percentage and multiplies by total system memory a second time. The Process Explorer correctly treats `ProcessItem.mem` as bytes.

## Expected

`code --status` should divide `ProcessItem.mem` by MiB directly on every platform, matching Process Explorer and the byte contract produced by `listProcesses`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.