Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Memory Analyzer » How to include retained size column (with precise or approximate values) in histogram command result(Print Retained size column in histogram command, or Deeper levels in dominator_tree command)
How to include retained size column (with precise or approximate values) in histogram command result [message #1853398] Thu, 30 June 2022 12:54 Go to next message
R Chinmay is currently offline R ChinmayFriend
Messages: 1
Registered: June 2022
Junior Member
Hello Eclipse MAT community, I really loved using this tool for heap analysis. But the major problem I am facing is that the histogram command does not include retained size by default (I actually would not care if it took a lot of time, because the hprof file I am testing with is usually small, around 100MB file with small number of objects too). I also tried using the dominator tree (grouped by class) api command, but it only gives the top level class details as a result from query command. Usually for my programs, it tells that the Thread class is taking about 99% of retained heap, but I would not be able to see what classes under Thread is taking more memory, which is possible in UI application of mat. Also calculating retained heap sizes in histogram table is possible in MAT UI application. But I am not able to find how to do it using the api, since I have to write a script which would a part of another program (which would use this result). If either including retained size column in histogram, or expanding dominator_tree command to print deeper levels is not possible using the API presently, could anyone please guide me how to do it using a custom query, or if it is not possible presently?
Thank you in advance.
Re: How to include retained size column (with precise or approximate values) in histogram command re [message #1853412 is a reply to message #1853398] Thu, 30 June 2022 16:41 Go to previous message
Andrew Johnson is currently offline Andrew JohnsonFriend
Messages: 205
Registered: July 2009
Senior Member
Memory Analyzer 1.13.0 calculates the approximate retained sizes for the histogram command by default.
573908 Generate RetainedSizeCache for classes during indexing

Another idea - the overview report calculates the histogram with the approximate retained sizes. See the source code for overview.xml Here is a snipppet.

	<query name="%overview.class_histogram">
		<param key="html.separate_file" value="true" />
		<param key="sort_column" value="#3" />
		<param key="derived_data_column" value="_default_=APPROXIMATE" />
		<command>histogram</command>
	</query>


Previous Topic:Locate Sockets
Next Topic:how to get gc root of object using oql ?
Goto Forum:
  


Current Time: Tue Jan 14 04:29:02 GMT 2025

Powered by FUDForum. Page generated in 0.04637 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top