English 中文(简体)
收集加工场read堆积记录
原标题:unix script to collect the thread dump logs of a process

我正试图提出一个有关哈希姆普特职能的问题。 我已撰写了一份试验守则,该守则将操作100多个read子,使用 j子或杀死我能够穿透我过程的某个read子。 问题在于,我无法立即抓住地下堆放场,我希望所有的地下垃圾堆放地都存放在档案中,直到这一过程结束。 是否有能够写到的中型指挥或手稿?

问题回答
#!/bin/bash

if [ $# -eq 0 ]; then
    echo >&2 "Usage: jstackSeries  [ <count> [ <delay> ] ]"
    echo >&2 "    Defaults: count = 10, delay = 1 (seconds)"
    exit 1
fi

pid=$1          # required
count=${2:-10}  # defaults to 10 times
delay=${3:-1} # defaults to 1 second

while [ $count -gt 0 ]
do
    jstack $pid >jstack.$pid.$(date +%H%M%S.%N)
    sleep $delay
    let count--
    echo -n "."
done

这里指的是:

http://howtodoinjava.com/ 12/19/how-to-get-thread-dump-in-lin-uxusing-jstack/





相关问题
Signed executables under Linux

For security reasons, it is desirable to check the integrity of code before execution, avoiding tampered software by an attacker. So, my question is How to sign executable code and run only trusted ...

encoding of file shell script

How can I check the file encoding in a shell script? I need to know if a file is encoded in utf-8 or iso-8859-1. Thanks

How to write a Remote DataModule to run on a linux server?

i would like to know if there are any solution to do this. Does anyone? The big picture: I want to access data over the web, using my delphi thin clients. But i´would like to keep my server/service ...

How can I use exit codes to run shell scripts sequentially?

Since cruise control is full of bugs that have wasted my entire week, I have decided the existing shell scripts I have are simpler and thus better. Here is what I have so far svn update /var/www/...

Good, free, easy-to-use C graphics libraries? [closed]

I was wondering if there were any good free graphics libraries for C that are easy to use? It s for plotting 2d and 3d graphs and then saving to a file. It s on a Linux system and there s no gnuplot ...

热门标签