-
Notifications
You must be signed in to change notification settings - Fork 100
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
v8 findrefstree command #115
Comments
I think we could probably do this but before diving into the technical side what would the output look like? The resulting tree can be very deep (if it passes through structures like linked lists) and very wide (if it ever passes through objects with many incoming references). I'm not sure how to make it presentable in a way that's useful. |
@hhellyer perhaps we can generate it into a common format that we've been discussing over here? nodejs/post-mortem#13 lldb may not be the best tool to search through the generated tree, but if it's exported in a common format we could write tools to import it into a database and run queries. Thoughts? |
I'm not sure if we could export the heap from a core dump into another format correctly. We currently have no way to get all the heap roots out of a core dump. (I'm fairly sure I've discussed this somewhere else but I can't find the reference.) Getting the incoming references is something you need as soon as you start doing any kind of heap dump analysis so it would be worth thinking about and discussing on that thread |
IMO the best way to meet this requirement would be a GUI front end to the core-dump reader, so you can click on an object and open up a 'reversed' view of the objects that refer to it, with collapsed/expanded views of arrays etc. We are some way from having that. However, I think we could do something in line-mode if we control the amount of output using counts and ".... 200 more like this" type messages, with options to expand fully. |
I was playing with some ideas on how to output this. Here is what I've got so far: For small trees, I believe something like this would work. We could add a Edit: for comparison, this is the retainers list on Chrome DevTools with the same script: |
Introduce a new command flag to `findrefs`, command --recursive allow user to transverse the whole references tree for the given object. Refs: nodejs#115
Introduce a new command flag to `findrefs`, command --recursive allow user to transverse the whole references tree for the given object. Refs: nodejs#115
Introduce a new command flag to `findrefs`, command --recursive allow user to transverse the whole references tree for the given object. Refs: nodejs#115
Introduce a new command flag to `findrefs`, command --recursive allow user to transverse the whole references tree for the given object. Refs: nodejs#115
It'd be really useful to have a
v8 findrefstree
command for solving memory leaks. This would take a reference to an object, and starting from that node, print out all objects that refer to that object, and its parents, recursively.Generally speaking this would be helpful for debugging memory leaks, as it's usually pretty obvious what objects are leaking, but not the root object(s) that's holding on to the leaking objects. Currently you'd have to run
v8 findrefs -r
over and over an object and its parent until you reached the root, which is slow and very tedious.Having a command that could recursively print out the tree of objects that refer to a specific object would simplify the debugging process for memory leaks.
The text was updated successfully, but these errors were encountered: