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

What is 'remainder'? #73

Open
youngledo opened this issue Oct 29, 2024 · 3 comments
Open

What is 'remainder'? #73

youngledo opened this issue Oct 29, 2024 · 3 comments

Comments

@youngledo
Copy link

I see that 'remainder' occupies a certain size on the interface, but I cannot see what it actually has. Can you explain what it is and when it will appear?

image

At times, its proportion is still significant, but I cannot see why it is so large.
企业微信截图_29cfc2b7-8d4a-48b7-ab9b-9f7382d9851b

@kgibm
Copy link
Member

kgibm commented Nov 19, 2024

"Remainder" is a generic feature of pie charts in MAT when the sum of slices don't add up to the total heap usage the pie chart represents: https://github.com/eclipse-mat/mat/blob/R_1.15.0/plugins/org.eclipse.mat.api/src/org/eclipse/mat/snapshot/query/PieFactory.java#L228-L233

The specific pie chart you're showing is the Top Consumers query in the addBiggestObjects method: https://github.com/eclipse-mat/mat/blob/R_1.15.0/plugins/org.eclipse.mat.api/src/org/eclipse/mat/inspections/TopConsumers2Query.java#L169

Basically that's going through the top level of the dominator tree and adding a pie slice if the retained heap of a dominator is greater than a percentage of the total heap (default = 1%).

So the large remainder in the second chart means that there are no large dominators consuming a majority of the heap. This is common with complex object graphs. When the dominator tree isn't useful, then the next steps include the histogram, leak suspects report, etc.: https://help.eclipse.org/latest/topic/org.eclipse.mat.ui.help/gettingstarted/basictutorial.html

@youngledo
Copy link
Author

Thanks, isn't this remainder also part of the heap, don't you need to pay attention to this memory?

@kgibm
Copy link
Member

kgibm commented Nov 21, 2024

Thanks, isn't this remainder also part of the heap, don't you need to pay attention to this memory?

Yes. The remaining dominators didn't exceed 1% of the heap so generally in this case the recommendation is to review other queries in MAT: https://help.eclipse.org/latest/topic/org.eclipse.mat.ui.help/gettingstarted/basictutorial.html

If none of those core queries help, generally what I do then is to go to the Histogram, sort by retained heap, find the largest non-JDK & non-framework classes, right click, Merge Shortest Paths to GC roots excluding phantom/soft/weak/etc. references and then calculate the minimum retained heap for referenced objects and explore the shortest paths to GC roots that retains the most of these.

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