日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

java hprof_java 性能之 hprof

發布時間:2024/1/23 编程问答 25 豆豆
生活随笔 收集整理的這篇文章主要介紹了 java hprof_java 性能之 hprof 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

JVM可以對java程序的cpu和heap進行 profiling。hprof 實際上是JVM中的一個native的庫,它會在JVM啟動的時候通過命令行參數來動態加載,并成為 JVM進程的一部分。

主要有兩種使用方式:

1.?java -agentlib:hprof=[:options] classname

2.?java -Xrunhprof[:options] classname

以下為 hprof 使用的幫助命令:

C:\Users\Administrator>java -agentlib:hprof=help

HPROF: Heap and CPU Profiling Agent (JVMTI Demonstration Code)

hprof usage: java -agentlib:hprof=[help]|[=, ...]

Option Name and Value ?Description ? ? ? ? ? ? ? ? ? ?Default

--------------------- ?----------- ? ? ? ? ? ? ? ? ? ?-------

heap=dump|sites|all ? ?heap profiling ? ? ? ? ? ? ? ? all

cpu=samples|times|old ?CPU usage ? ? ? ? ? ? ? ? ? ? ?off

monitor=y|n ? ? ? ? ? ?monitor contention ? ? ? ? ? ? n

format=a|b ? ? ? ? ? ? text(txt) or binary output ? ? a

file= ? ? ? ? ? ?write data to file ? ? ? ? ? ? java.hprof[{.txt}]

net=: ? ? ?send data over a socket ? ? ? ?off

depth= ? ? ? ? ? stack trace depth ? ? ? ? ? ? ?4

interval= ? ? ? ? ?sample interval in ms ? ? ? ? ?10

cutoff= ? ? ? ? output cutoff point ? ? ? ? ? ?0.0001

lineno=y|n ? ? ? ? ? ? line number in traces? ? ? ? ? y

thread=y|n ? ? ? ? ? ? thread in traces? ? ? ? ? ? ? ?n

doe=y|n ? ? ? ? ? ? ? ?dump on exit? ? ? ? ? ? ? ? ? ?y

msa=y|n ? ? ? ? ? ? ? ?Solaris micro state accounting n

force=y|n ? ? ? ? ? ? ?force output to ? ? ? ? y

verbose=y|n ? ? ? ? ? ?print messages about dumps ? ? y

Obsolete Options

----------------

gc_okay=y|n

Examples

--------

- Get sample cpu information every 20 millisec, with a stack depth of 3:

java -agentlib:hprof=cpu=samples,interval=20,depth=3 classname

- Get heap usage information based on the allocation sites:

java -agentlib:hprof=heap=sites classname

Notes

-----

- The option format=b cannot be used with monitor=y.

- The option format=b cannot be used with cpu=old|times.

- Use of the -Xrunhprof interface can still be used, e.g.

java -Xrunhprof:[help]|[=, ...]

will behave exactly the same as:

java -agentlib:hprof=[help]|[=, ...]

Warnings

--------

- This is demonstration code for the JVMTI interface and use of BCI,

it is not an official product or formal part of the JDK.

- The -Xrunhprof interface will be removed in a future release.

- The option format=b is considered experimental, this format may change

in a future release.

默認情況下,hprof 出來的信息會寫入當前 classpath 目錄的?java.hprof.txt 文件中。

創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎

總結

以上是生活随笔為你收集整理的java hprof_java 性能之 hprof的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。