JVM 内存分析工具:HeapAudit

jopen 7年前

你是否看见过java.lang.OutOfMemory这些类似的错误信息?判断一个系统好坏,高性能非常重要。而阻碍系统性能提高的第一大元凶就是内存问题,更糟糕的是如果GC不能完全释放无用的内存,这会导致内存溢出,从而产生更严重的后果。 找出内存问题的元凶是一件非常困难的任务,幸运的是,heapaudit可以解决这个问题。

HeapAudit是一个Java代理,审计JVM进程的堆分配。

HeapAudit 运行在三种模式:

  • STATIC: This requires a simple integration hook to be implemented by the java process of interest. The callback hook defines how the allocations are recorded and the callback code is only executed when the java agent is loaded.
  • DYNAMIC: This injects HeapQuantile recorders to all matching methods and dumps heap allocations to stdout when removed. Be aware, a lot of recorders, including nested ones, may be injected if the supplied matching pattern is not restrictive enough.
  • HYBRID: This launches like the static use case but dynamically determines where to inject recorders.

项目主页:http://www.open-open.com/lib/view/home/1394610918801