How to find a Java Memory Leak

后端 未结 11 1096
遇见更好的自我
遇见更好的自我 2020-11-22 07:48

How do you find a memory leak in Java (using, for example, JHat)? I have tried to load the heap dump up in JHat to take a basic look. However, I do not understand how I am s

11条回答
  •  佛祖请我去吃肉
    2020-11-22 08:17

    As most of us use Eclipse already for writing code, Why not use the Memory Analyser Tool(MAT) in Eclipse. It works great.

    The Eclipse MAT is a set of plug-ins for the Eclipse IDE which provides tools to analyze heap dumps from Java application and to identify memory problems in the application.

    This helps the developer to find memory leaks with the following features

    1. Acquiring a memory snapshot (Heap Dump)
    2. Histogram
    3. Retained Heap
    4. Dominator Tree
    5. Exploring Paths to the GC Roots
    6. Inspector
    7. Common Memory Anti-Patterns
    8. Object Query Language

提交回复
热议问题