死锁的Dump文件

package com.stono.thread;

public class DeadLockDemo {
private static String A = "A";
private static String B = "B";
public static void main(String[] args) {
new DeadLockDemo().deadLock();
}
private void deadLock() {
Thread t1 = new Thread(new Runnable() {
public void run() {
synchronized (A) {
try {
Thread.currentThread().sleep(2000);
} catch (Exception e) {
e.printStackTrace();
}
synchronized (B) {
System.out.println("1");
}
}
}
});
Thread t2 = new Thread(new Runnable() {
public void run() {
synchronized (B) {
synchronized (A) {
System.out.println("2");
}
}
}
});
t1.start();
t2.start();
}
}

dump文件:

2017-12-24 07:49:47
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.5-b02 mixed mode): "DestroyJavaVM" #12 prio=5 os_prio=0 tid=0x00000000029de800 nid=0x17d8 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE "Thread-1" #11 prio=5 os_prio=0 tid=0x0000000018c1a000 nid=0x17a4 waiting for monitor entry [0x000000001986f000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.stono.thread.DeadLockDemo$2.run(DeadLockDemo.java:28)
- waiting to lock <0x00000000d702ba68> (a java.lang.String)
- locked <0x00000000d702ba98> (a java.lang.String)
at java.lang.Thread.run(Unknown Source) "Thread-0" #10 prio=5 os_prio=0 tid=0x0000000018c17000 nid=0xc88 waiting for monitor entry [0x000000001976f000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.stono.thread.DeadLockDemo$1.run(DeadLockDemo.java:19)
- waiting to lock <0x00000000d702ba98> (a java.lang.String)
- locked <0x00000000d702ba68> (a java.lang.String)
at java.lang.Thread.run(Unknown Source) "Service Thread" #9 daemon prio=9 os_prio=0 tid=0x0000000018bff800 nid=0x11d4 runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE "C1 CompilerThread2" #8 daemon prio=9 os_prio=2 tid=0x0000000017845800 nid=0x1270 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE "C2 CompilerThread1" #7 daemon prio=9 os_prio=2 tid=0x000000001783f000 nid=0x1664 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE "C2 CompilerThread0" #6 daemon prio=9 os_prio=2 tid=0x0000000017839800 nid=0xa64 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE "Attach Listener" #5 daemon prio=5 os_prio=2 tid=0x000000001782f000 nid=0x1484 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE "Signal Dispatcher" #4 daemon prio=9 os_prio=2 tid=0x0000000018bb3800 nid=0xecc runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE "Finalizer" #3 daemon prio=8 os_prio=1 tid=0x0000000002ee0800 nid=0x1618 in Object.wait() [0x0000000018b6f000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00000000d7090180> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(Unknown Source)
- locked <0x00000000d7090180> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(Unknown Source)
at java.lang.ref.Finalizer$FinalizerThread.run(Unknown Source) "Reference Handler" #2 daemon prio=10 os_prio=2 tid=0x00000000177e8000 nid=0xb9c in Object.wait() [0x0000000018a6e000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00000000d7088210> (a java.lang.ref.Reference$Lock)
at java.lang.Object.wait(Unknown Source)
at java.lang.ref.Reference$ReferenceHandler.run(Unknown Source)
- locked <0x00000000d7088210> (a java.lang.ref.Reference$Lock) "VM Thread" os_prio=2 tid=0x00000000177e6800 nid=0x1b70 runnable "GC task thread#0 (ParallelGC)" os_prio=0 tid=0x0000000002e06000 nid=0xbfc runnable "GC task thread#1 (ParallelGC)" os_prio=0 tid=0x0000000002e08000 nid=0x1898 runnable "GC task thread#2 (ParallelGC)" os_prio=0 tid=0x0000000002e09800 nid=0x1108 runnable "GC task thread#3 (ParallelGC)" os_prio=0 tid=0x0000000002e0b000 nid=0x18ac runnable "VM Periodic Task Thread" os_prio=2 tid=0x0000000018c04000 nid=0x684 waiting on condition JNI global references: 7 Found one Java-level deadlock:
=============================
"Thread-1":
waiting to lock monitor 0x0000000002edda68 (object 0x00000000d702ba68, a java.lang.String),
which is held by "Thread-0"
"Thread-0":
waiting to lock monitor 0x0000000002ee05b8 (object 0x00000000d702ba98, a java.lang.String),
which is held by "Thread-1" Java stack information for the threads listed above:
===================================================
"Thread-1":
at com.stono.thread.DeadLockDemo$2.run(DeadLockDemo.java:28)
- waiting to lock <0x00000000d702ba68> (a java.lang.String)
- locked <0x00000000d702ba98> (a java.lang.String)
at java.lang.Thread.run(Unknown Source)
"Thread-0":
at com.stono.thread.DeadLockDemo$1.run(DeadLockDemo.java:19)
- waiting to lock <0x00000000d702ba98> (a java.lang.String)
- locked <0x00000000d702ba68> (a java.lang.String)
at java.lang.Thread.run(Unknown Source) Found 1 deadlock.

死锁的Dump文件的更多相关文章

  1. dump文件解析之探索.Net的内存

    前言: 对于需要长时间运行的.net程序,有时需要我们查看内存的使用有没有内存泄露问题. 我们可以从dump文件中找到答案. Dump的看点 用dump文件来分析内存,到底我们需要关心哪些点呢? 内存 ...

  2. dump解析入门-用VS解析dump文件进行排障

    突然有一天部署在服务器的一个应用挂掉了,没办法只能进入服务器打开 [事件查看器]查看下,好不容易找到了打开后一脸懵逼 事件查看器查到的内容根本对我们排障没有任何作用. 在这个时候如果有对应的dump文 ...

  3. 【转】Windows Dump文件获取

    dump文件是进程的内存镜像.可以把程序的执行状态,即当时程序内存空间数据通过调试器保存到dump文件中. 1.利用WinDbg里的adplus来获取dump文件 Adplus.vbs 是一个Visu ...

  4. [Java基础] 使用JMAP dump及分析dump文件

    转载:http://blog.csdn.net/kevin_luan/article/details/8447896 http://liulinxia02.blog.163.com/blog/stat ...

  5. Windows下获取Dump文件以及进程下各线程调用栈的方法总结(转)

    1. Dump文件的用途 Dump文件, 主要用于诊断一个进程的运行状态,尤其是碰到崩溃(Crash)或者挂起(hang)不响应时,需要分析它的工作状态.  除了平时常见的attach到这个进程, 分 ...

  6. 【应用服务 App Service】快速获取DUMP文件(App Service for Windows(.NET/.NET Core))

    问题情形 当应用在Azure 应用服务App Service中运行时,有时候出现CPU,Memory很高,但是没有明显的5XX错误和异常日志,有时就是有异常但是也不能明确的指出具体的代码错误.当面临这 ...

  7. 使用GDB 追踪依赖poco的so程序,core dump文件分析.

    前言 在windows 下 系统核心态程序蓝屏,会产生dump文件. 用户级程序在设置后,程序崩溃也会产生dump文件.以方便开发者用windbg进行分析. so,linux 系统也有一套这样的东东- ...

  8. 使用MAT(Memory Analyzer Tool)工具分析dump文件--转

    原文地址:http://gao-xianglong.iteye.com/blog/2173140?utm_source=tuicool&utm_medium=referral 前言 生产环境中 ...

  9. gdb调试常用实用命令和core dump文件的生成

      1.生成core dump文件的方法: $  ulimit -c //查看是否为0 如果为0 $   ulimit -c unlimited 这样在程序崩溃以后会在当前目录生成一个core.xxx ...

随机推荐

  1. Eigen下载安装

    首先提供Eigen的两个重要网站 官方网站 下载地址 1.下载 wget http://bitbucket.org/eigen/eigen/get/3.3.5.tar.gz 2.解压缩 tar -zx ...

  2. phpexcel乱码问题

    php导出Excel乱码,只需在header函数前加入ob_end_clean();//清除缓冲区,避免乱码

  3. BestCoder Round #52 (div.2) HDU 5418 Victor and World (DP+状态压缩)

    [题目链接]:pid=5418">click here~~ [题目大意]: 问题描写叙述 经过多年的努力,Victor最终考到了飞行驾照. 为了庆祝这件事,他决定给自己买一架飞机然后环 ...

  4. 多本Web前端深度修炼书籍(提供网盘下载链接)

    书籍介绍:这本书涵盖了html5新增标签和功能,而且提供了jquerymobile,Phonegap,Sencha Touch框架的介绍和应用,最后还带了一个移动web应用的样例,绝对是移动web开发 ...

  5. HTML5图片上传预览

    HTML5实现图片的上传预览,需要使用FileReader对象. FileReader: The FileReader object lets web applications asynchronou ...

  6. ORA 12505 Listener does not currently know of SID given in connection descriptor

    oracle数据库正常启动后.在本地能够正常訪问,可是远程使用sqldevelop却不能訪问.提示ORA 12505 Listener does not currently know of SID g ...

  7. hive 运行sqlclient异常

    FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. java.lang.Runtim ...

  8. Java 定制工具库 —— Print(import static)

    创建自己的工具库以减少或消除重复的程序代码.例如,我们在Print类中,对常常用到的System.out.println()封装调用以减少输入负担.这样,我们在使用该类时,可以用一个更具可读性的 im ...

  9. IDE-IntelliJ IDEA

    IDE-IntelliJ IDEA 主题.字体.编辑区主题.文件编码修改.乱码问题 主题修改 上图标注 1 所示为 IntelliJ IDEA 修改主题的地方,可以通过打开左上角的File -> ...

  10. sql server 更新满足条件的某一条记录

    上图数据:SNum为”18004XXXXX000001K2GW 4000 L1C“,OffLineStation为“OP1010”的有两条数据,当where条件中为上述两者时会同时更新这两条数据,并不 ...