Java thread dump: BLOCKED thread without “waiting to lock …”

前端 未结 4 1409
夕颜
夕颜 2020-12-05 10:58

I\'m having difficulties in understanding the thread dump I got from jstack for a Spring MVC web application running on Tomcat 6 (java 1.6.0_22, Linux).

I see blocki

4条回答
  •  既然无缘
    2020-12-05 11:24

    Check if the finalizer thread is blocked or waiting.

    During a GC sweep, the GC will "stop the world" to perform its cleanup. The definition of "world" depends on the garbage collector being used and context. It may be a small cluster of threads or all of them. Before officially collecting garbage, GC will invoke the object's finalize().

    If you are in the undesirable situation where you are implementing finalizer methods, the finalization code may be blocking it from finishing and the 'world' stays stopped.

    This is most obvious when seeing lots of threads being permanently-blocked by some unknown magic force: Look up the code where the blocking occurs and it will make no sense; there is no blocking code to be found anywhere near it and the dumps will not divulge what monitor it is waiting on because there isn't one. The GC has paused the threads.

提交回复
热议问题