#!/bin/sh
#read -t 30 -p "请输入jstat命令监控间隔,次数:" time count
read -p "输入jstat命令监控间隔(1s输出一次,输入1000):" time
if [ -z "$time" ];then
        time=1000
    fi
read -p "输入jstat命令监控次数:" count
if [ -z "$count" ];then
        count=10
    fi

for javaid in `ps -ef|grep java|grep 'Xms' |awk '{print $2}'`
do
        echo  当前java pid=$javaid
        echo  当前应用 `ps -ef|grep "$javaid"`
        jstat -gcutil "$javaid" $time $count

done

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-12
  • 2022-12-23
猜你喜欢
  • 2021-10-31
  • 2022-12-23
  • 2022-02-09
  • 2021-07-20
  • 2021-09-30
  • 2021-12-14
  • 2021-04-02
相关资源
相似解决方案