posts - 21,  comments - 0,  trackbacks - 0
          JConsole:
          1) java -Dcom.sun.management.jmxremote MainClass
          2) JDK\bin\jconsole {java pid}
          在jconsole的界面可以看到簡單的內(nèi)存使用情況

          Hat:
          1) java -Xrunhprof:file=dump.hprof,format=b MainClass
          2) hat dump.hprof
          3) Browse http://localhost:7000
          dump.hprof是java程序產(chǎn)生的dump文件名

          如何用netbeans5.5 profiler 調(diào)試 memory Leak (JDK1.5)
          1) 下載如下包,
          netbeans-5_5-windows.exe -- netbeans 5.5
          netbeans-profiler-5_5-win.exe -- profiler
          profiler-server-55-windows-15.zip -- remote pack. 與profiler是分開的,作remote attach的時候要用
          2) netbeans 與profiler 都安裝在你本地
          3)將profiler-server-55-windows-15.zip解壓到你遠程的機器
          4)運行profiler-server-55-windows-15\bin\calibrate.bat
          5) 把下面的參數(shù)加到你的JVM啟動參數(shù)里面:
          ?-agentpath:<profiler-server-55-windows-15>\lib\deployed\jdk15\windows\profilerinterface.dll=<profiler-server-55-windows-15>\lib,5140
          6) 啟動你的Java.exe時,java 程序?qū)Φ却鉧ttach,通過netbeans attach后,你可以看到Objects使用的信息了

          記得要選中:"Record both object creation and garbage collection (Object Liveness Profiling)"
          This option provides additional information about how many objects of each type are still alive, as well as data on live objects. The results are displayed in the Object Liveness Results.
          posted on 2007-02-14 17:56 自強不息的豬 閱讀(934) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導(dǎo)航:
           
          <2007年2月>
          28293031123
          45678910
          11121314151617
          18192021222324
          25262728123
          45678910

          常用鏈接

          留言簿(3)

          隨筆檔案(21)

          文章分類(2)

          文章檔案(8)

          links

          最新隨筆

          搜索

          •  

          積分與排名

          • 積分 - 15297
          • 排名 - 1991

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 岫岩| 那曲县| 大宁县| 南安市| 德州市| 乡宁县| 革吉县| 定兴县| 云和县| 元阳县| 涟水县| 江陵县| 万源市| 泸定县| 堆龙德庆县| 广安市| 外汇| 长阳| 西宁市| 合山市| 桐柏县| 沈丘县| 常山县| 黑山县| 西乌珠穆沁旗| 兰考县| 凌源市| 新源县| 正阳县| 庆城县| 公安县| 和田县| 潍坊市| 刚察县| 开化县| 泸西县| 寻甸| 凌海市| 塔河县| 桐柏县| 富宁县|