Discussions
Categories
- 197K All Categories
- 2.5K Data
- 546 Big Data Appliance
- 1.9K Data Science
- 450.8K Databases
- 221.9K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 31 Multilingual Engine
- 552 MySQL Community Space
- 479 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3.1K ORDS, SODA & JSON in the Database
- 556 SQLcl
- 4K SQL Developer Data Modeler
- 187.2K SQL & PL/SQL
- 21.4K SQL Developer
- 296.4K Development
- 17 Developer Projects
- 139 Programming Languages
- 293.1K Development Tools
- 110 DevOps
- 3.1K QA/Testing
- 646.1K Java
- 28 Java Learning Subscription
- 37K Database Connectivity
- 159 Java Community Process
- 105 Java 25
- 22.1K Java APIs
- 138.2K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 19 Java Essentials
- 162 Java 8 Questions
- 86K Java Programming
- 81 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 205 Java User Groups
- 24 JavaScript - Nashorn
- Programs
- 473 LiveLabs
- 39 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 175 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 233 Portuguese
Eclipse MAT – Titbits

Eclipse MAT is a great JVM Memory Analysis tool. Here are few tid-bits to use it effectively.
Fig: Eclipse MAT
1. Use stand-alone version
Two versions of Eclipse MAT is available:
1. Stand-alone
2. Eclipse Plugin
Based on my personnel experience, stand-alone version seems to works better and faster then plugin version. So I would highly recommend installing Stand-alone version.
2. Eclipse MAT – heap size
If you are analyzing a heap dump of size say 2 GB, allocate at least 1 GB additional space for Eclipse MAT. If you can allocate more heap space than it’s more the merrier. You can allocate additional heap space for Eclipse MAT tool, by editing MemoryAnalyzer.ini file. This file is located in the same folder where MemoryAnalyzer.exe is present. To the MemoryAnalyzer.ni you will add -Xmx3g at the bottom.
Example:
-startup plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar --launcher.library plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20140603-1326 -vmargs -Xmx3g
3. Enable ‘keep unreachable objects’
From it’s reporting Eclipse MAT removes the object which it thinks as ‘unreachable’. As ‘unreachable’ objects are eligible for garbage collection, MAT doesn’t displays them in the report. Eclipse MAT classifies Local variables in a method as ‘unreachable objects’. Once thread exits the method, objects in local variables will be eligible for garbage collection.
However, there are several cases where thread will go into a ‘BLOCKED’ or prolonged ‘WAITING’, ‘TIMED_WAITING’ state. In such circumstances local variables will be still alive in memory, occupying space. Since Eclipse MAT default settings doesn’t show the unreachable objects, you will not get visibility into these objects. You can change the default settings in Eclipse MAT 1.4.0 version by:
1. Go to Window > Preferences …
2. Click on ‘Memory Analyzer’
3. Select ‘Keep unreachable objects’
4. Click on ‘OK’ button
Fig: Eclipse MAT 1.4.0, showing how to enable ‘Keep unreachable objects’
4. Smart Data Settings
Eclipse MAT by default displays data in bytes. It’s difficult to read large object sizes in bytes and digest it. Example Eclipse MAT prints object size like this: “193,006,368”. It’s much easier if this data can be displayed in KB, MB, GB i.e. “184.07 MB”.
Fig: Eclipse MAT default option showing object size in bytes
Eclipse MAT provides an option to display object size in KB, MB, GB based on their appropriate size. It can be enabled by following below steps:
- Go to Window > Preferences …
- Click on ‘Memory Analyzer’
- In the ‘Bytes Display’ section select ‘Smart: If the value is a gigabyte or …’
- Click on ‘OK’ button
Fig: Settings to enable ‘smart’ data display
Once this setting change is made, all data will appear in much more readable KB, MB, GB format, as shown in below figure.