1

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.

Wayne Werner
  • 49,299
  • 29
  • 200
  • 290
  • You can probably search for the name. It has to be set somewhere. – Brodo Fraggins Jul 25 '14 at 22:03
  • I don't think you can actually find out what created or even started the thread. As you could create a thread in one place, and start it in a completely different place. And once started its doing its own thing not tied to what started it to begin with. As Brodo mentions, searching for the name 'Read Daemon' might be the best bet. – Doswell Jul 25 '14 at 22:10
  • See also http://stackoverflow.com/questions/7788280/memory-leak-when-redeploying-application-in-tomcat – Raedwald Jul 25 '14 at 22:34
  • @BrodoFraggins I grepped the source with no luck – Wayne Werner Jul 26 '14 at 01:08

1 Answers1

3

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).

eckes
  • 10,103
  • 1
  • 59
  • 71
  • My best guess is that's the source, but I'm not sure just why it's not getting closed. Our app is a bit large, and not terribly well designed. – Wayne Werner Jul 26 '14 at 01:13
  • It does sound like a non closed database connection/statement. QZDASOINIT job is related to serving ODBC normally. – eckes Jul 26 '14 at 01:51
  • is there something i could search for that might lead me to fimd the missing close? – Wayne Werner Jul 26 '14 at 02:04
  • Hmm, Driver#getConnection()/close() or AS400#connect()/disconnect() should be the two most resource intensive calls. – eckes Jul 26 '14 at 02:10