![]() We also covered basic views provided in MAT. In this post, we covered the basics of MAT and heap dump analysis. Shows the most expensive objects grouped by class and by packageĭetect classes loaded by multiple class loader. Histogram lists the number of instances per class, shallow and retained heap size This will show all the objects which current object refers to. ![]() Right click on the object > List Object > With outgoing references. This will show all the objects which reference current object. Right click on the object > List Object > With incoming references. This also shows the Shallow heap, retained heap and percentage of total memory consumed by these objects. List the biggest objects and objects referenced by them. Retained heap of an object is the sum of shallow sizes of all the objects which will be unreferenced if the current object is removed. Shallow heap is the memory consumed by one object. You should be able to see the overview of heap dump XX: +HeapDumpOnOutOfMemoryError -XX:HeapDumpPath = hdump.hprof ![]() If you don't want to do GC before taking heap dump then use jmap file = hdump.hprof Īdd below arguments in environment variables to automatically take heap dump when the application goes out of memory. This would do a full GC first and then take heap dump. We can install the latest java easily using the below homebrew command and set it to default java version using below commands brew install adoptopenjdkĮxport PATH=“/usr/ 11/ bin:$ PATH” ' > ~/.zshrc & source ~/.zshrc ![]() To use MAT we need to have Java version at least greater than 11 at the time of writing. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |