-
Notifications
You must be signed in to change notification settings - Fork 123
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
Discussion: How to map traced leaks to React components, or HTML DOM path #47
Comments
There are a few ways:
memlab view-heap --node-id <leaked object ID> Either way, you can view object properties in objects and closure variables defined in closure context, so you can search object names, function names in your code base to locate the source. In case object names and function name is too general, we often do a conjunction search of all the object properties in objects and closure variables defined in closure context to narrow down the scope (which can quickly narrow down to the location most of the time in our use case). PS: The internal UI mentioned in the engineering blog post has a few shortcuts to make the process easier (integrated with Meta infra so not open sourced). Just an idea if anyone is interested in integrating with their own infra. |
This is specific to debugging React. In either |
MemLab faithfully presents the reference chain in V8 heap snapshots (serialization of C++ data structure in v8 engine), those are V8 internal data structure for organizing the heap, most of the time we can ignore those objects (with type |
Hi! @JacksonGL. I just wanted to let you know that memlab is fantastic! But, as you say, it would be easier to use with a UI. So I wonder if making the UI open source will be part of the plans. If not, can I contribute an open-source UI to this repo? |
@LuciNyan Thanks for your contributions. The internal UI is integrated with Meta infra, so there is no plan to open source the UI in the near future. Can you explain what kind of UI you have in mind? Is it a web app, electron app, or extending the Chrome DevTools? |
I'm thinking of a web app or a chrome extension. I read that blog you mentioned, but I don't think I know enough details about how you guys use memlab. So I'm still lacking a detailed vision of the exact functionality of this UI. By the way, I think memlab is a powerful tool. Large enterprises may have some internal tools to monitor and troubleshoot memory leaks. But for small to medium-sized teams, There is not yet a mature tool. Memlab can fill this gap. I want to do something to make memlab easier to use. I currently have this in mind:
What do you think? |
I agree having a better user interface and APIs for integration with other test frameworks would make MemLab easier to use.
The scope and implementation of Web UI can vary depending on what functionalities to include. Here are some ideas:
For more extended use cases, the Web UI could be a memory leak monitoring and management system. This may involve integration with CI/CD, code searching/viewing system, and backend data stores depending on different orgs' infra.
For integration with different testing frameworks, this could be implemented by providing APIs that take heap snapshots based on each testing framework (e.g., Playwright, Cypress, Jest). Calling those test-framework-specific APIs in existing tests dumps heap snapshots and meta data in the format that can be processed by the memlab heap analyzer. Please also check out the discussion in #35. |
Hi! @JacksonGL. Thanks for the detailed advice! This sounds great! I'm sure memlab will become an even more influential tool! |
Hi memlab team,
Is there any tricks / instruction for mapping console output to react code / html components?
I did some homework by reading https://facebook.github.io/memlab/docs/guides/guides-detached-dom
However the case I met is not as straightforward as shown in the tutorial.
Detailed: Questions:
Thanks a lot.
Here is the whole console output:
The text was updated successfully, but these errors were encountered: