[Bug] Chrome crashes with "Out of Memory" error when viewing large profiles (~375MB)
- Dominant language
- TypeScript
- Stars
- 6.8k
- Forks
- 320
- PR merge metrics
- No merged PRs in 30d
Description
**Summary:**
When attempting to load and view a large profile file (~375 MB) generated by `py-spy`, the browser tab crashes with an "Out of Memory" error. This occurs specifically when trying to render the view for the largest thread in the profile.
**Steps to Reproduce:**
1. Generate a large profile file. (In my case, a 375 MB speedscope file was generated using `py-spy` over a ~48-hour period).
2. Navigate to `https://www.speedscope.app/`.
3. Click "Browse..." and select the 375 MB file.
4. After the file is parsed, click on the largest thread in the profile selector dropdown to attempt to view it.
5. The browser tab hangs for a moment, then crashes.
**Expected Behavior:**
The flamegraph or time-order view should render for the selected thread, even if it is slow or requires some level of aggregation to be usable. The browser tab should not crash.
**Actual Behavior:**
The Chrome tab crashes, displaying the "Aw, Snap!" error page.
> **Error code: Out of Memory**
**Environment:**
* **Browser:** Google Chrome Version 139.0.7258.128 (Official Build) (64-bit)
* **Operating System:** Windows 11
* **Speedscope Version:** `speedscope.app` accessed on [2025-08-25]
**Additional Context:**
The profile file is quite large due to a long-running process analysis. I understand that this is an edge case, but it would be great if speedscope could handle these larger files more gracefully.
I am willing to share the profile file privately if it would help with debugging.
**Potential Solutions / Discussion:**
Some ideas that come to mind:
* **Data Aggregation/Downsampling:** Could speedscope dynamically reduce the sampling resolution for very large data sets before rendering?
* **Detail just for selection:** Only rendering a selected portion of the flamegraph in detail
Contributor guide
Assessment
This issue has not been assessed yet.