Repository navigation
Description
Type: Performance Issue
Hello,
i am trying to code a Pythen Application. But VS Code keeps consinstently crashing after about 15 Minutes. I have a core dump from journalctl. All Extensions (Not the Python ones) are disabled.
Here is the beginning of the Core Dump:
Nov 22 00:19:11 debian plasmashell[79249]: <--- Last few GCs --->
Nov 22 00:19:11 debian plasmashell[79249]: [79249:0x38dc0011c000] 1375313 ms: Mark-Compact 3664.0 (4086.1) -> 3658.4 (4087.6) MB, pooled: 1 MB, 35.18 / 0.00 ms (average mu = 0.995, current mu = 0.766) task; scavenge might not succeed
Nov 22 00:19:11 debian plasmashell[79249]: [79249:0x38dc0011c000] 1375467 ms: Mark-Compact 3665.7 (4087.6) -> 3659.9 (4089.3) MB, pooled: 0 MB, 39.36 / 0.00 ms (average mu = 0.990, current mu = 0.745) task; scavenge might not succeed
Nov 22 00:19:11 debian plasmashell[79249]: <--- JS stacktrace --->
Nov 22 00:19:11 debian plasmashell[79249]: FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
Nov 22 00:19:11 debian plasmashell[79249]: ----- Native stack trace -----
Nov 22 00:19:11 debian plasmashell[79275]: [1122/001911.776191:ERROR:elf_dynamic_array_reader.h(64)] tag not found
Nov 22 00:19:11 debian plasmashell[79275]: [1122/001911.776530:ERROR:elf_dynamic_array_reader.h(64)] tag not found
Nov 22 00:19:11 debian plasmashell[79275]: [1122/001911.776682:ERROR:elf_dynamic_array_reader.h(64)] tag not found
Nov 22 00:19:11 debian plasmashell[79275]: [1122/001911.792050:ERROR:directory_reader_posix.cc(43)] opendir /home/marvin/.config/Code/Crashpad/attachments/a2b04a1d-7e42-44f8-9285-1bc787e4b08c: No such file or directory (2)
Nov 22 00:19:19 debian systemd-coredump[83388]: [🡕] Process 79249 (code) of user 1000 dumped core.
If possible i can send the rest of the dumped Core too.
But this happens at almost exactly 15 Minutes every time.
Last one: Consumed 14min 55.100s CPU time
Before: Consumed 16min 43.285s CPU time.
And before that: Consumed 14min 27.663s CPU time.
If you need more informate i can provide everything you need.
Thanks in advance
VS Code version: Code 1.95.3 (f1a4fb1, 2024-11-13T14:50:04.152Z)
OS version: Linux x64 6.1.0-27-amd64
Modes:
System Info
| Item | Value |
|---|---|
| CPUs | AMD Ryzen 7 3800X 8-Core Processor (16 x 2199) |
| GPU Status | 2d_canvas: enabled canvas_oop_rasterization: enabled_on direct_rendering_display_compositor: disabled_off_ok gpu_compositing: enabled multiple_raster_threads: enabled_on opengl: enabled_on rasterization: enabled raw_draw: disabled_off_ok skia_graphite: disabled_off video_decode: enabled video_encode: disabled_software vulkan: disabled_off webgl: enabled webgl2: enabled webgpu: disabled_off webnn: disabled_off |
| Load (avg) | 1, 2, 2 |
| Memory (System) | 46.96GB (38.32GB free) |
| Process Argv | --crash-reporter-id 9e41d979-2ff7-435d-b01a-c6add81964e1 |
| Screen Reader | no |
| VM | 0% |
| DESKTOP_SESSION | plasma |
| XDG_CURRENT_DESKTOP | KDE |
| XDG_SESSION_DESKTOP | KDE |
| XDG_SESSION_TYPE | x11 |
Process Info
CPU % Mem MB PID Process
0 192 83645 code main
0 0 83649 zygote
0 240 83686 gpu-process
0 0 83746 broker
0 0 83650 zygote
0 0 83652 zygote
0 337 83707 window [1] (camper.py - camper - Visual Studio Code)
0 48 83691 utility-network-service
0 192 83784 extensionHost [1]
0 0 83882 /home/marvin/.vscode/extensions/ms-python.python-2024.20.0-linux-x64/python-env-tools/bin/pet server
0 144 83796 shared-process
0 0 84070 /bin/sh -c /usr/bin/ps -ax -o pid=,ppid=,pcpu=,pmem=,command=
0 96 83797 fileWatcher [1]
0 96 83851 ptyHost
0 0 83868 /usr/bin/bash --init-file /usr/share/code/resources/app/out/vs/workbench/contrib/terminal/common/scripts/shellIntegration-bash.sh
0 0 83973 /usr/bin/bash --init-file /usr/share/code/resources/app/out/vs/workbench/contrib/terminal/common/scripts/shellIntegration-bash.sh
Workspace Info
| Window (camper.py - camper - Visual Studio Code)
| Folder (camper): 42 files
| File types: png(19) py(8) test(3) suo(1) json(1) md(1) old(1) sh(1)
| Conf files:;
Extensions (3)
| Extension | Author (truncated) | Version |
|---|---|---|
| debugpy | ms- | 2024.12.0 |
| python | ms- | 2024.20.0 |
| vscode-pylance | ms- | 2024.11.2 |
Activity
MarviBiene commentedon Nov 21, 2024
Full Core Dump
`Nov 22 00:19:11 debian plasmashell[79249]: <--- Last few GCs --->
Nov 22 00:19:11 debian plasmashell[79249]: [79249:0x38dc0011c000] 1375313 ms: Mark-Compact 3664.0 (4086.1) -> 3658.4 (4087.6) MB, pooled: 1 MB, 35.18 / 0.00 ms (average mu = 0.995, current mu = 0.766) task; scavenge might not succeed
Nov 22 00:19:11 debian plasmashell[79249]: [79249:0x38dc0011c000] 1375467 ms: Mark-Compact 3665.7 (4087.6) -> 3659.9 (4089.3) MB, pooled: 0 MB, 39.36 / 0.00 ms (average mu = 0.990, current mu = 0.745) task; scavenge might not succeed
Nov 22 00:19:11 debian plasmashell[79249]: <--- JS stacktrace --->
Nov 22 00:19:11 debian plasmashell[79249]: FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
Nov 22 00:19:11 debian plasmashell[79249]: ----- Native stack trace -----
Nov 22 00:19:11 debian plasmashell[79275]: [1122/001911.776191:ERROR:elf_dynamic_array_reader.h(64)] tag not found
Nov 22 00:19:11 debian plasmashell[79275]: [1122/001911.776530:ERROR:elf_dynamic_array_reader.h(64)] tag not found
Nov 22 00:19:11 debian plasmashell[79275]: [1122/001911.776682:ERROR:elf_dynamic_array_reader.h(64)] tag not found
Nov 22 00:19:11 debian plasmashell[79275]: [1122/001911.792050:ERROR:directory_reader_posix.cc(43)] opendir /home/marvin/.config/Code/Crashpad/attachments/a2b04a1d-7e42-44f8-9285-1bc787e4b08c: No such file or directory (2)
Nov 22 00:19:19 debian systemd-coredump[83388]: [🡕] Process 79249 (code) of user 1000 dumped core.
░░ Subject: Speicherabbild für Prozess 79249 (code) generiert
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░ Documentation: man:core(5)
░░
░░ Prozess 79249 (code) ist abgebrochen worden und
░░ ein Speicherabbild wurde generiert.
░░
░░ Üblicherweise ist dies ein Hinweis auf einen Programmfehler und sollte
░░ als Fehler dem jeweiligen Hersteller gemeldet werden.
Nov 22 00:19:20 debian systemd[1251]: Started [email protected] - Launch DrKonqi for a systemd-coredump crash (PID 83390/UID 0).
░░ Subject: A start job for unit UNIT has finished successfully
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ A start job for unit UNIT has finished successfully.
░░
░░ The job identifier is 943.
Nov 22 00:19:20 debian drkonqi-coredump-launcher[83424]: Unable to find file for pid 79249 expected at "kcrash-metadata/79249.ini"
Nov 22 00:19:20 debian drkonqi-coredump-launcher[83424]: QFile::remove: Empty or null file name
Nov 22 00:19:20 debian drkonqi-coredump-launcher[83424]: Nothing handled the dump :O
Nov 22 00:19:21 debian kwin_x11[1562]: qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 54037, resource id: 188743683, major code: 15 (QueryTree), minor code: 0
Nov 22 00:19:21 debian kwin_x11[1562]: qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 54099, resource id: 44041296, major code: 18 (ChangeProperty), minor code: 0
Nov 22 00:19:23 debian systemd[1251]: app-code-0d3e75aa1d2a405ab1adce121caaa194.scope: Consumed 14min 55.100s CPU time.
░░ Subject: Resources consumed by unit runtime
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ The unit UNIT completed and consumed the indicated resources.
`
deepak1556 commentedon Nov 22, 2024
Can you provide the dump file following the steps at https://github.com/microsoft/vscode/wiki/Native-Crash-Issues#creating-a-crash-report
MarviBiene commentedon Nov 22, 2024
Hello,
i reproduced the Crash and found the probable cause. If i am running the Python Debugger VS Code crashes after about a minute or so.
Here is the Crash Dump file.
b0142729-f9ff-4359-9382-771bcae3f07a.zip
MarviBiene commentedon Nov 28, 2024
Hello,
Is there a workaround I can apply for this? It's quite annoying with the high amount of crashes.
Thank you
Marvin
deepak1556 commentedon Nov 28, 2024
Based on the crash dump the browser process is aborted due to heap limit, and given you have narrowed down the scenario to using python debugger it hints to a possible memory leak in core.
We would need to inspect the memory allocations of the main process to debug this issue further, please try the following next steps
code --inspect=9229chrome://inspect/#devices4.a) If you don't, click
Open dedicated DevTools for Nodewhich will open the DevTools window4.b) Under connection tab set
localhost:9229and it should connect to the process after a second5) Now switch to the
Memorytab in the DevTools6) Check the following option
Allocations on timelinewith allocation stack traces enableddeepak1556 commentedon Nov 28, 2024
If you have some reliable repro steps with a minimal sample workspace for us to try, that would also help. Please be as detailed as possible in the steps to repro the issue.
MarviBiene commentedon Nov 28, 2024
Hello,
Here is the requested memory allocation:
Heap-20241128T181921.heaptimeline.zip
I did some testing and found that this code alone causes VS Code to crash:
Here is the offical link of SimulRPI: https://pypi.org/project/SimulRPi/
Here is just the memory allocation from just the few lines:
Heap-20241128T190136-fewlines.heaptimeline.zip
I can run it fine without VS Code, but in VS Code it crashes shortly. And after i stopped the Debugger, Chrome still shows big Memory allocations.
Thank you,
Marvin
deepak1556 commentedon Nov 29, 2024
Thanks for the profile and the sample, I can repro the issue.
The array held by the event comes from the deserialzing ipc message via the onBuffer callback

based on the retainer path seems like the event was emitted for ptyhostService._onProcessData

I then tried to repro based on the example to get better stack from OSS, here are the steps
test.pywith contents from Codes Crashes after about 15 Minutes #234393 (comment)pip3 install SimulRPiPython Debugger: Python Debugger: Debug Python FileFrom heap snapshot via OSS, the strong reference to the event array comes from the service which seems expected. Is there something the terminal service can do to flush the buffer in these cases ? Moving to you Daniel Imms (@Tyriar) for further analysis.
35 remaining items
dmitrivMS commentedon Sep 14, 2026
The fix should be in the next Insiders build and in VS Code 1.139 stable.
dmitrivMS commentedon Sep 15, 2026
Windows validation report for the terminal OOM fix
Validated the fix from #323980 / cherry-pick #336198 against freshly synced and built
mainat 38246c086c8. The relevant IPC/channel implementation and regression tests match the cherry-pick's head. This was a current-main validation, not a separaterelease/1.138build.Environment: Windows x64, Code OSS 1.139.0-dev, Electron 42.10.0; build Node 24.18.0 / npm 11.16.0. Desktop scenarios used isolated workspaces and profiles.
Results
npm run compile, Electron preparation, and built-in extension synchronizationThe focused tests cover default versus selective event buffering, lazy subscriptions for unused process events, live event delivery, preservation of early and live pty-host lifecycle notifications, restart listener cleanup, and direct-channel replay completion after renderer writes.
The smoke suite covers terminal editors and panel/editor moves, input auto replies, persistence, ordinary and contributed profiles (including JavaScript Debug Terminal), tabs, splits, join/unsplit, and shell-integration sequence handling. It was run with
--tracing --fail-zero -g Terminalusing the existing smoke runner.Additional desktop scenarios
Main-process memory under ANSI output
The producer emitted 151.61 MiB over 240.03 seconds. Memory was sampled from the Electron main process, not the renderer: 26 samples, approximately 10-second intervals, with forced GC before each sample. Steady-state comparisons exclude the first 30 seconds; the final sample includes a 10-second post-output settling period.
No main-process crash or sustained retained-heap accumulation proportional to terminal output was observed in this workload.
Setup notes and limitations
ms-vscode.js-debugbuilt-in extension had not been downloaded. Runningnpm run download-builtin-extensionscorrected the setup; the complete suite was rerun and passed, including all three cases. No product source changes were needed.LocalPty/BasePtyduring terminal churn. Those renderer implementation files are unchanged by this fix, but the warnings were not attributed by an A/B run and were not fixed as part of this validation. Passing functional tests should not be read as proof of the absence of all renderer disposal issues.Conclusion: No functional regression or main-process OOM growth pattern was observed in the exercised Windows terminal scenarios. The source worktree remained clean, and test instances and temporary profiles were cleaned up.
dmitrivMS commentedon Sep 15, 2026
The is now in latest VS Code Insiders.
dmitrivMS commentedon Sep 15, 2026
FYI - the fix will be included in the VS Code 1.138.0 stable release.