-
Notifications
You must be signed in to change notification settings - Fork 392
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support node's heap profiling #4461
Comments
Can I try this? I did some digging around and found: https://source.chromium.org/chromium/chromium/src/+/main:v8/include/js_protocol.pdl;l=696-729 So maybe using the existing importers as reference I might be able to get something working. |
Oh yes, please ! |
I'll try to give some more context to the memory tooling in the profiler UI. You can read an introduction in our docs already: https://profiler.firefox.com/docs/#/./memory-allocations The simple memory usage (just incrementing or decrementing) is reported in counters, that gives the memory track. But I believe that the data in these heap profiles are more detailed than this, and we want to use the more advanced mechanisms. Then the 2 other ways are the Native Allocations and the JS Allocations. In Gecko they're reported in markers, but they're converted to other tables in the processed format. I believe that's what we should target. You can read some more about these types in: Lines 197 to 228 in b69a16c
They're inserted in the thread as optional properties: Lines 643 to 645 in b69a16c
Our support for memory profiling is very "adhoc" in that it's very much tailored to the current data we get from the gecko profiler. For example we only support deallocations / retained memory support with the But getting an importer to work with any of the chrome data would already be a fantastic achievement. Once we have the importer we can tweak things a lot more easily, and then make the related code more generic. Hope this helps :-) |
@julienw I see some words and lines that are familiar to what I used yesterday, so hopefully that's a sign that I haven't completely messed up 🙂 I've put up draft PR #4467 for some feedback when you have time. Let me know if things are looking even remotely close to OK, in which case I can add a snapshot test on top of it. |
Node can output a heap profile file when run with
--heap-prof
. It would be good to be able to import it into the profiler UI.Here is an example:
Heap.20230208.132746.551039.0.002.heapprofile.gz
┆Issue is synchronized with this Jira Task
The text was updated successfully, but these errors were encountered: