查看java進程記憶體簡單樣本

來源:互聯網
上載者:User

標籤:cpu佔用   java   nts   %x   util   pid   gen   read   lsof   

1、擷取pid

lsof -i:port

 

2、根據擷取到pid,查看gc的相關資訊

jstat -gc pid 2000 5    查看gc資訊,每兩秒重新整理一次,總重新整理五次。其相關熟悉列舉如下:

S0C:Survivor0 的容量
S1C:Survivor1, 與S0C一樣
S0U: Survivor0 的利用情況,utilization
S1U:
EC:eden 新生代使用方式
EU:
OC,OU:老年代的一些情況
PC,PU:Permanent space 當前永久代的情況
YGC: Numbers of young generation GC events
YGCT: Young generation Garbage collection time
FGC : full gc 次數
FGCT: full gc 時間
GCT: total gc 時間

 

3、查看線程資訊

ps -mp pid -o THREAD,tid,time|wc -l 查看線程數

ps -mp pid -o THREAD,tid,time | sort -rn | head -10 線程列表,並按照CPU佔用高的線程排序

 

4、將線程tid轉成16進位

printf "%x\n" tid

 

5、查看線程占記憶體資訊

jstack pid |grep 16進位的線程id -A 30

 

查看java進程記憶體簡單樣本

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.