Commit graph

7 commits

Author SHA1 Message Date
Zaggy1024
07d1b222c7 Meta: Simplify GC heap explorer's class list rendering
We don't need to pass the filter and sort to the render function from
all these locations, the callers always use values from the same
inputs. Instead, just use the values directly from cached references
the input elements.

This fixes the class filter not being applied correctly after a refresh
autofills the old value back into it.
2026-03-01 21:50:51 +01:00
Zaggy1024
a3922aa570 LibGC+Meta: Include inline frames in the GC explorer's stack trace 2026-03-01 21:50:51 +01:00
Zaggy1024
03284abee9 LibGC+Meta: Display a frame size in the GC graph explorer's stack trace
This can help us track down overly-large frames that might be
contributing stale roots.
2026-03-01 21:50:51 +01:00
Zaggy1024
1a3e8fdf60 LibGC+Meta: Look up and display stack frames for StackPointer roots
This adds a stack trace to the JSON output from GC graph dumps which
is shown in a default-collapsed tray on the right side of the graph
explorer. When a stack pointer root is selected, the stack frame it
originated from is highlighted in the tray.
2026-03-01 21:50:51 +01:00
Zaggy1024
677a22c63e Meta: Make the GC explorer's source locations' word wrapping prettier
Remove `word-break: break-all` and instead insert word breaks before
each transition from non-word to word characters. As an example, with
breaks represented by vertical bars:

Foo<|Bar>::|baz()

Thus, when wrapping a line, it'll break on whitespace, or on characters
indicating that there is more to follow.
2026-03-01 21:50:51 +01:00
Andreas Kling
64d033b31a LibWebView+test-web: Print heap explorer URL after dumping GC graph
When dumping a GC graph, we now write the output as a .js file
containing `var GC_GRAPH_DUMP = <json>;` instead of raw JSON.
This allows gc-heap-explorer.html to load the dump via a
dynamically created <script> element, avoiding CORS restrictions
that prevent file:// pages from fetching other file:// URLs.

After dumping, both the browser and test-web print a clickable
file:// URL that opens the heap explorer with the dump pre-loaded.

The heap explorer's drag-and-drop file picker also accepts both
the new .js format and plain .json files.
2026-02-01 22:46:09 +01:00
Andreas Kling
aaa0fad2c0 Meta: Add interactive GC heap explorer tool
This adds a self-contained HTML tool for visualizing and exploring
LibGC heap dumps (JSON format). Features include:

- Drag-and-drop JSON file loading
- Class breakdown with filtering and sorting
- Interactive force-directed graph visualization
- Toggle between incoming/outgoing edge focus
- Node detail panel with edges and path-to-root finder
- Search by pointer address (hex or decimal)
- Collapsible root node browser

The tool is useful for investigating memory leaks and understanding
object retention in the GC heap.
2026-01-21 23:46:59 +01:00