microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.75k stars 29.1k forks source link

Test: JS Heap Snapshots viewer #199239

Closed connor4312 closed 11 months ago

connor4312 commented 11 months ago

Refs: https://github.com/microsoft/vscode/issues/191920

Complexity: 3

Create Issue


This month I added a custom editor to allow viewing JavaScript heap snapshots.

  1. Debug any JavaScript, and run Take Performance Profile > Heap Snapshot. That will collect a .heapsnapshot file into your workspace folder. (Doing this in browsers is fairly fast, but Node is slow and can take several moments)
  2. Open the file. Poke around the table view and check that things are sane and work as they should. The numbers should match the same file opened in the Memory tab in Chrome (not Edge, Edge tweaks Chrome's calculation)
  3. Click on the "graph" button beside a node and see that it opens a graph of its retaininers. You will be prompted to install the flame chart visualizer if not installed, as it contains the heavier-weight graphing components.
  4. Check that graph navigation is sane and works well. You can change the distance of displayed retaininers, but be warned that high numbers may take increasing amounts of time to chart, especially for Node.js profiles.
aiday-mar commented 11 months ago

Loving the graphing functionality :)

connor4312 commented 11 months ago

Thank you for the thorough testing :)

IanButterworth commented 10 months ago

The julia language Profile stdlib provides a way to record .heapsnapshot files that can be viewed in chrome devtools, but they hang indefinitely in this viewer and print the following error

2023-12-30 19:27:38.621 [info] ExtensionService#_doActivateExtension ms-vscode.vscode-js-profile-table, startup: false, activationEvent: 'onCustomEditor:jsProfileVisualizer.heapsnapshot.table'
2023-12-30 19:27:38.772 [error] UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "invalid profile JSON".

Is there any way to get any further debug information?

Here is a zipped example 81416_881767189633791.heapsnapshot.zip

I thought I wouldn't open a dedicated issue until we can rule out the issue being on the julia side