1. 程式人生 > 其它 >docker下jstack檔案分析

docker下jstack檔案分析

top

docker ps

進入docker

docker exec -it 2ba867d597b2 /bin/sh

top

jps

把當前堆疊資訊收集到當前資料夾的file.txt下

jstack -l pid >> file.txt

linux下建立資料夾 mkdir dumpFile

linux下建立或檢視檔案 touch tmp.txt

把docker裡的檔案拷貝到主機

模板:docker cp [OPTIONS] CONTAINER:SRC_PATH DEST_PATH

例子:docker cp 2ba867d597b2:/thread.txt /dumpFile/

然後就將thread.txt下載到本地的/dumpFile資料夾下

下載工具IBM Thread and Monitor Dump Analyzer for Java (TMDA)

https://www.ibm.com/support/pages/ibm-thread-and-monitor-dump-analyzer-java-tmda下載jar包

按照步驟啟動

====================================================================================

Steps

  1. Download jca*.jar:https://public.dhe.ibm.com/software/websphere/appserv/support/tools/jca/jca468.jar
  2. Open a terminal or command prompt and change directory to where you downloaded the JAR file.
  3. Ensure that Java is on your PATH to run the tool.
  4. Launch the tool: java -jar jca*.jar

====================================================================================

匯入檔案 點選