how to find out who create a thread in java?

后端 未结 4 1354
鱼传尺愫
鱼传尺愫 2020-12-29 15:13

in tomcat,if a webapp did stop a none daemon thread,tomcat can not be shutdown by shutdown.sh

for example:

public class demo implements ServletContex         


        
4条回答
  •  余生分开走
    2020-12-29 15:55

    If you have an IDE like Eclipse or Intellij, you can set break points in the various Thread constructors. You can remotely attach to process using the debugger. The debugger will stop the process when the thread is being constructed. You can observe things like the thread name. You can also use break points with condition if you want to match on the specific thread name.

    Setting break points. https://www.ibm.com/developerworks/library/os-ecbug/

    Remote debugging https://dzone.com/articles/a-practical-guide-to-java-remote-debugging-in-the

提交回复
热议问题