简体   繁体   中英

Is it possible to (and how do I) find out what class created a named thread in Java?

In Tomcat 7 on Ubuntu 12.04 64-bit I get the following error:

SEVERE: The web application [/MyApplication] appears to have started a thread named [AS400 Read Daemon [system:mysystem:093048/QUSER/QZDASOINIT]] but has failed to stop it. This is very likely to create a memory leak.

I want to find out what created that thread so I can figure out how to stop it. I can attach to Tomcat with jdb, if that helps.

You could install your own logging security manager (which records the stacks for the create thread permission), but by default that information is not remembered (only the parent thread group and the access control context, unless overwritten).

Another option is to use something like BTrace to instrument thread creation (with recording of call sites). But this is not possible after the fact and requires some setup.

Maybe it helps to thread dump your system regularly and look in what code the thread in question is living.

The name of the thread sounds pretty much like the JTOpen Toolbox for IBM iSeries (TAFKA AS/400).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM