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

Why does the "group by class" interface of the dominator tree need to return objectIds? #317

Open
mycxu opened this issue Dec 30, 2024 · 2 comments

Comments

@mycxu
Copy link
Contributor

mycxu commented Dec 30, 2024

When I request this interface, it returns the objectId of all class objects, but I haven't found where these objectIds are used. Additionally, when the number of objects is very large, this interface becomes extremely time-consuming. Are these IDs used somewhere?
{"namespace":"heap-dump","api":"dominatorTree.roots","target":"d6e46031-e176-4190-bb51-dd2042a43d67","parameters":{"groupBy":"BY_CLASS","searchText":"","searchType":"by_name","sortBy":"retainedHeap","ascendingOrder":false,"page":1,"pageSize":50}}
image

@D-D-H
Copy link
Contributor

D-D-H commented Dec 31, 2024

It seems that 'objectIds' is not required for Dominator Tree API.

I remember there are APIs that need it, like Histogram.

when the number of objects is very large, this interface becomes extremely time-consuming.

Yes, it is indeed a problem. We didn't find an elegant way to solve it.

Maybe we can consider maintaining a map (generating and returning a key when objectIds is needed for subsequent requests). But there will be a new problem: when to clean the map.

@mycxu
Copy link
Contributor Author

mycxu commented Jan 2, 2025

Yes, the timing for map cleanup does not seem easy to estimate. I directly modified the Dominator Tree interface so that it no longer returns objectIds. The program's functionality can still operate normally with this change, and it appears that it will not impact other interfaces.

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

No branches or pull requests

2 participants