Add GC heap developer tools for profiling and debugging
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 12/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- rust, wasm
- Lĩnh vực
- developer-experience, tooling
Hướng nghiên cứu
The issue names no source files or tests, so start by deciding scope: it has two separate parts, allocation-site sampling for profiling and heap-graph serialization for debugging. Read the linked fast-bernoulli crate and the Firefox Profiler and DevTools memory formats it proposes reusing. Done means a maintainer-agreed design, not a patch, so raise the format and sampling questions in the thread first.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
For profiling
"Why is the program spending so much time in GC?" aka "where am I allocating all this stuff that is forcing GC?"
We should support sampling the stack on GC allocation. These samples can then be coalesced and displayed as a tree or flamegraph, similar to how time/cpu profiling is often displayed.
Not all GC allocations are equal: a cons cell is cheaper than a large array. So we want to check whether we should sample the stack per byte allocated and not per object allocated. We can use https://github.com/fitzgen/fast-bernoulli for this.
The firefox profiler supports allocation stack sampling, so I presume its data format does as well, and we could maybe reuse it for this here too.
For debugging
"Why is my GC heap usage so high?"
"What is keeping this large object alive?"
We should be able to serialize the GC heap into an on-disk format that we can then run analyses on to answer questions like:
- What are the objects taking up the most space in the GC heap?
- Why is this object, that I would have expected not to be in use anymore and reclaimed by the collector, still live in the GC heap?
- What is unintentionally retained (i.e. the GC version of "leaked") after the program does X?
(1) is best answered by (a) a dominator tree analysis and ranking an object by its retained size (as opposed to its self size), and (b) taking a census and categorizing objects by type or allocation site and displaying them as a treemap.
(2) is best answered by an analysis that reports the N shortest paths from a GC root to the object of interest.
(3) is best answered by diffing heap snapshots before and after repeatedly doing X.
I don't know if there is any popular tool that has a stable heap snapshot format where we can just serialize our heap graph into that format and then it runs these analyses for us and displays their results in a UI for us.
I built the Firefox DevTools's memory tool, and we could reuse its protobuf heap snapshot serialization format to allow importing our heap snapshots into its UI, but this wouldn't be quite as slick as the firefox profiler experience, because the memory tool doesn't exist as a standalone web page, you'd have to open up the firefox devtools and manually import the snapshot(s).
Maybe there is a standalone alternative I'm not aware of?
- Ngôn ngữ chính
- Rust
- Star
- 18.9k
- Fork
- 2k
- Merge trung bình
- 1 ngày 6 giờ
- Pull request đã merge (30 ngày)
- 238
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của bytecodealliance/wasmtime
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
bytecodealliance/wasmtime#15536 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
bytecodealliance/wasmtime#15455 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
wasi-preview1-component-adapter: fd_write does not invalidate cached InputStream, causing stale readsCó thể đã có người làm @dpfens đã nhận 13 ngày trước. Đang mởwasi
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
bytecodealliance/wasmtime#15296 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug wasm-proposal:exceptions wasmtime:debugging
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
bytecodealliance/wasmtime#14102 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
wasm-proposal:gc
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
bytecodealliance/wasmtime#13808 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của bytecodealliance/wasmtime
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area: plugins bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
clipy-recorder/clipy#1039 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
valkey-io/valkey-glide#7975 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
gofractally/psibase#2379 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Qwen stream parser: a chunk with "error": null is treated as a stream errorCó thể đã có người làm @Beehtrix đã nhận hôm nay. Đang mởarea:models bug good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
brekkylab/ailoy#681 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày