How can I monitor the thread count of a process on linux?

前端 未结 17 1138
暖寄归人
暖寄归人 2020-12-02 03:53

I would like to monitor the number of threads used by a specific process on Linux. Is there an easy way to get this information without impacting the performance of the proc

17条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-02 04:45

    $ ps H p pid-id

    H - Lists all the individual threads in a process

    or

    $cat /proc/pid-id/status

    pid-id is the Process ID

    eg.. (Truncated the below output)

    root@abc:~# cat /proc/8443/status
    Name:   abcdd
    State:  S (sleeping)
    Tgid:   8443
    VmSwap:        0 kB
    Threads:    4
    SigQ:   0/256556
    SigPnd: 0000000000000000
    

提交回复
热议问题