How to find a Java Memory Leak

后端 未结 11 852
遇见更好的自我
遇见更好的自我 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 07:53

    You really need to use a memory profiler that tracks allocations. Take a look at JProfiler - their "heap walker" feature is great, and they have integration with all of the major Java IDEs. It's not free, but it isn't that expensive either ($499 for a single license) - you will burn $500 worth of time pretty quickly struggling to find a leak with less sophisticated tools.

提交回复
热议问题