JProfiler

What's JProfiler?

JProfiler is a professional tool for analyzing what is going on inside a running JVM. You can use it in development, for quality assurance and for firefighting missions when your production system experiences problems.
JProfiler是一個專業(yè)的分析工具,用于分析在運行的JVM。當您的生產系統遇到問題時,您可以在開發(fā)、質量保證和消防任務中使用它。

四個主要功能topic

  • Method calls:
    This is commonly called "CPU profiling". Method calls can be measured and visualized in different ways. The analysis of method calls helps you to understand what your application is doing and find ways to improve its performance.
    “方法調用”通常被稱為“CPU 分析”。“方法調用”可以以不同的方式被衡量和可視化。使用“方法調用”分析能幫助你理解應用當前正在做什么,并能幫助找到可優(yōu)化的地方。
  • Allocations:
    Analyzing objects on the heap with respect to their allocations, reference chains and garbage collection falls into the category of "memory profiling". This functionality enables you to fix memory leaks, use less memory in general and allocate fewer temporary objects.
    分析堆上的對象的分配、引用鏈和垃圾收集屬于“內存分析”的范疇。此功能使您能夠修復內存泄漏,一般使用較少的內存,并分配較少的臨時對象。
  • Thread and locks:
    Threads can hold locks, for example by synchronizing on an object. When multiple threads cooperate, deadlocks can occur and JProfiler can visualize them for you. Also, locks can be contended, meaning that threads have to wait before they can acquire them. JProfiler provides insight into threads and their various locking situations.
    線程可以保持鎖,例如通過對象同步。當多個線程合作時,死鎖可能會發(fā)生,JProfiler可以為您可視化它們。此外,鎖也可以被競爭,這意味著線程必須等待才能獲得它們。JProfiler提供了對線程及其各種鎖定情況的洞察。
  • Higher level subSystem:
    Many performance problems occur on a higher semantic level. For example, with JDBC calls, you probably want to find out which SQL statement is the slowest. For subsystems like that, JProfiler offers "probes" that attach specific payloads to the call tree.
    “高層子系統”:許多性能問題都發(fā)生在較高的語義級別上。例如,JDBC連接,你可能想找到Sql語句執(zhí)行最慢。對于那樣的子系統,JProfiler提供探測的方式,將特殊的負載加到調用樹上。

JProfiler安裝

  1. 在IntelliJ IDEA中作為一個插件使用,安裝方法如下:
    IntelliJ IDEA--->Preferences--->Plugins--->搜索 JProfiler安裝,然后重啟IntelliJ IDEA即可。
    IDEA安裝JProfiler插件

    通過這種方法可在啟動項目的時候看到JVM使用信息,如下,
    Run with JProfiler

    2.在設備上安裝JProfiler工具。
    官網下載并安裝,官網地址
    安裝成功后,JProfiler就作為一個獨立的app存在于設備之上,比如我們可以將 內存溢出的輸出文件使用JProfiler打開等等。

另外,也可以在IntelliJ IDEA中設置JProfiler工具的安裝路徑,我們可以IDEA中直接調用JProfiler這個工具。設置用法如下:
IntelliJ IDEA--->Preferences--->Tools--->JProfiler, 設置JProfiler executable路徑。如下,


JProfiler executable

其實JProfiler和Eclipse Memory analyzer的用處一樣,都是為了分析JVM使用情況而生。

?著作權歸作者所有,轉載或內容合作請聯系作者
【社區(qū)內容提示】社區(qū)部分內容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發(fā)布,文章內容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內容

友情鏈接更多精彩內容