-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
src: track memory retainer fields #26161
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -197,6 +197,17 @@ class MemoryTracker { | |
inline void Track(const MemoryRetainer* retainer, | ||
const char* edge_name = nullptr); | ||
|
||
// Useful for parents that do not wish to perform manual | ||
// adjustments to its `SelfSize()` when embedding retainer | ||
// objects inline. | ||
// Put a memory container into the graph, create an edge from | ||
// the current node if there is one on the stack - there should | ||
// be one, of the container object which the current field is part of. | ||
// Reduce the size of memory from the container so as to avoid | ||
// duplication in accounting. | ||
inline void TrackInlineField(const MemoryRetainer* retainer, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure what this is trying to achieve, is there a use case of this API? Normally the size of the pointer to the retainer should be accounted into the self size of the parent but self size of the retainer should not be accounted, so I can't tell when it's necessary to do a subtraction - maybe there is a misuse of the API? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this is trying to address the issues that came up from #26099 there are two ways to solve that:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @joyeecheung - thanks. Probably these many scenarios exists (with a component
We have If I follow your approach 1, we need to perform that in all such scenarios? in which case arguably the parent retainer (Worker's referencing object if any) could do the same for worker, and potentially render the Retainer abstraction meaningless? second proposal looks fair to me, but would love to hear from @addaleax as well. Can There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I’m not sure, but I don’t really see this as a issue/as not “tracking” these fields? Then again, re-naming is not a big deal, so I’m okay with anything. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
That depends on whether we want to display AsyncRequest separately as a Node referenced by the Worker node, and any other fields referenced by those AsyncRequests recursively.
The abstraction helps adding nodes recursively instead of tracking everything from the root, allowing the MemoryRetainer implementations define how they want their fields to be tracked.
Right, the fields are not really stack allocated if the whole thing is not stack allocated.
I am fine with the current naming if the comments are changed to reflect when this method should be used and what issue it is trying to address. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @joyeecheung - thanks, I will amend the comments, aligning with above conversation. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @joyeecheung - amended the comment, ptal! |
||
const char* edge_name = nullptr); | ||
|
||
inline v8::EmbedderGraph* graph() { return graph_; } | ||
inline v8::Isolate* isolate() { return isolate_; } | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.