Skip to content
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

When taking a heap snapshot, dump all string values to a file or view #6

Open
zoherghadyali opened this issue Mar 7, 2022 · 1 comment
Labels
feature New feature or request

Comments

@zoherghadyali
Copy link
Contributor

In apps where (string) objects take up a large portion of the heap, provide an option that allows developers to run additional queries over that data (such as regex) to find patterns for what kinds of strings contribute the most to memory footprint. Optionally, indicate how many strings are duplicates of each other.

Potential problems: Indexing the list of strings could require more memory from the tool.

@zoherghadyali zoherghadyali added the feature New feature or request label Mar 7, 2022
@joselea
Copy link
Member

joselea commented Mar 15, 2022

This kind of processing can be done in a separate program like the text editor of choice of the developer. DevTools could add a button to export all the strings to a file but I wonder if this is an overkill given that *.heapsnapshot files are basically *.json files that can already be opened by a text editor.

As of right now a developer could save a heapsnapshot file, open it in VSCode, find the keyword "strings" and scroll through the array of all the strings in the file. The bad thing about this approach is that "strings" also contains the names of nodes and edges.

By doing some pre-processing we could save a csv file of just the nodes of type string with their corresponding size.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants