JProfiler
JProfiler是Java剖析器。JProfiler直观的用户界面能够帮助找到性能瓶颈,并指明内存漏洞和解决线程问题。
JProfiler 特征:
内存剖析
JProfiler的内存视图部分可以提供动态的内存使用状况更新视图和显示关于内存分配状况信息的视图。所有的视图都有几个聚集层并且能够显示现有存在的对象和作为垃圾回收的对象。
所有对象——显示类或在状况统计和尺码信息堆上所有对象的包。你可以标记当前值并显示差异值。
记录对象——显示类或所有已记录对象的包。你可以标记出当前值并且显示差异值。
分配请求树——显示一棵请求树或者方法、类、包或对已选择类有带注释的分配信息的J2EE组件。
分配热点——显示一个列表,包括方法、类、包或分配已选类的J2EE组件。你可以标注当前值并且显示差异值。对于每个热点都可以显示它的跟踪记录树。
堆遍历
在JProfiler的堆遍历器中,你可以对堆的状况进行快照并且可以通过选择步骤下寻找感兴趣的对象。堆遍历器有五个视图:
类——显示所有类和它们的实例。
分配——为所有记录对象显示分配树和分配热点。
索引——为单个对象和“显示到垃圾回收根目录的路径”提供索引图的显示功能。还能提供合并输入视图和输出视图的功能。
数据——为单个对象显示实例和类数据。
时间——显示一个对已记录对象的解决时间的柱状图。
CPU剖析器
JProfiler提供不同的方法来记录请求树以优化性能和细节。线程或者线程组以及线程状况可以被所有的视图选择。所有的视图都可以聚集到方法、类、包或J2EE组件等不同层上。CPU视图部分包括:
请求树——显示一个积累的自顶向下的树,树中包含所有在JVM中已记录的请求队列。JDBC,JMS和JNDI服务请求都被注释在请求树中。请求树可以根据servlet和JSP对URL的不同需要进行拆分。
热点——显示消耗时间最多方法的列表。对每个热点都能够显示回溯树。该热点可以按照方法请求,JDBC,JMS和JNDI服务请求以及按照URL请求来进行计算。
请求图——显示一个从已选方法、类、包或J2EE组件开始的请求队列的图。
线程剖析
对线程剖析,JProfiler提供以下视图:
线程历史——显示一个与线程活动和线程状态在一起的活动时间表。
线程监控——显示一个列表,包括所有的活动线程以及它们目前的活动状况。
固定探测图表——显示一个包含了所有在JVM里的固定的图表。
目前使用的监测器——显示目前使用的监测器并且包括它们的关联线程。
历史检测记录——显示重大的等待事件和阻塞事件的历史记录。
监测使用状态——显示分组监测,线程和监测类的统计监测数据。
VM 自动测量技术
观察JVM的内部状态,JProfiler提供了不同的自动测量视图,如:
堆栈——显示一个堆栈的使用状况和堆栈尺寸大小活动时间表。
对象——显示一张关于活动对象与数组的图表的活动时间表。
垃圾收集器——显示一张关于垃圾回收活动的活动时间表。
类——显示一个与已装载类的图表的活动时间表。
线程——显示一个与动态线程图表的活动时间表。
JProfiler 支持下列平台:Windows XP、Windows Server 2003、Windows 2000、Windows NT 4.0、Windows 98;Mac OS X 10.1/2/3/4;Linux;Solaris 8/9/10;Solaris 10;AIX 5.2/5.3;HP-UX 11i
JProfiler
JProfiler is an award-winning all-in-one Java profiler. JProfiler’s intuitive GUI helps you find performance bottlenecks, pin down memory leaks and resolve threading issues.
JProfiler supports the following modes of operation:
Live profiling of a local session
Once you define how your application is started, JProfiler can profile it and you immediately see live data from the profiled JVM. To eliminate the need for session configuration, you can use one of the many IDE plugins to profile the application from within your favorite IDE.
Live profiling of a remote session
By modifying the VM parameters of the java start command you can get any Java application to listen for a connection from the JProfiler GUI. The profiled application can not only run on your local computer, JProfiler can attach to a profiled application over the network. In addition, JProfiler provides numerous integration wizards for all popular application servers that help you in setting up your application for profiling.
Offline profiling
You do not have to connect with the JProfiler GUI to the profiled application in order to profile it: With offline profiling you can use the JProfiler API to control the profiling agent and save snapshots to disk. At a later time you can open these snapshots in the JProfiler GUI or programmatically export profiling views with the command line export tool or the export ant task.
Snapshot comparisons
In JProfiler, you can save a snapshot of all current profiling data to disk. JProfiler offers a rich comparison facility to see what has changed between two or more snapshots. Alternatively you can create comparison reports programmatically with the command line comparison tool or the comparison ant task.
The following list gives a high level overview of the profiling views in JProfiler:
Memory profiling ——
JProfiler’s memory view section offers dynamically updated views on memory usage and views that show information about allocations spots. All views have several aggregation levels and can show live and garbage collected objects.
All objects
Shows classes or packages of all objects on the heap with instance counts and size information. You can mark current values and show differences.
Recorded objects
Shows classes or packages of all recorded objects. You can mark current values and show differences.
Allocation call tree
Shows a call tree or methods, classes, packages or J2EE components with annotated allocations of selected classes.
Allocation hot spots
Shows a list of methods, classes, packages or J2EE components that allocate selected classes. You can mark current values and show differences. The tree of backtraces can be shown for each hot spot.
Heap walker——
In JProfiler’s heap walker you can take a snapshot of the heap and drill down to objects of interest by performing selection steps. The heap walker has five views:
Classes
Shows all classes and their instances.
Allocations
Shows allocation tree and allocation hot spots for recorded objects.
References
Shows a graph of references for individual objects and offers a "show path to garbage collector root" functionality. Also offers cumulated views for incoming and outgoing references.
Data
Shows instance and class data for individual objects.
Time
Shows a time-resolved histogram of recorded objects.
CPU profiling——
JProfiler offers various ways to record the call tree to optimize for performance or detail. The thread or thread group as well as the thread status can be chosen for all views. All views can be aggregated on a method, class, package or J2EE component level. The CPU view section contains:
Call tree
Shows a cumulated top-down tree of all recorded call sequences in the JVM. JDBC, JMS and JNDI service calls are annotated i