许多线程处于IN_NATIVE状态

时间:2013-02-03 17:26:01

标签: java tomcat ldap

我们在tomcat节点中看到一些奇怪的问题。我拿线程转储来查看线程状态。在大多数线程处于IN_NATIVE状态。有些身体可以告诉我它是什么以及是什么原因引起的?这是线程的堆栈跟踪。

Thread 677: (state = IN_NATIVE)
 - java.net.SocketInputStream.socketRead0(java.io.FileDescriptor, byte[], int, int, int) @bci=0 (Compiled frame; information may be imprecise)
 - java.net.SocketInputStream.read(byte[], int, int) @bci=84, line=129 (Compiled frame)
 - com.sun.net.ssl.internal.ssl.InputRecord.readFully(java.io.InputStream, byte[], int, int) @bci=21, line=293 (Compiled frame)
 - com.sun.net.ssl.internal.ssl.InputRecord.read(java.io.InputStream, java.io.OutputStream) @bci=32, line=331 (Compiled frame)
 - com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(com.sun.net.ssl.internal.ssl.InputRecord, boolean) @bci=44, line=789 (Compiled frame)
 - com.sun.net.ssl.internal.ssl.SSLSocketImpl.readDataRecord(com.sun.net.ssl.internal.ssl.InputRecord) @bci=15, line=746 (Compiled frame)
 - com.sun.net.ssl.internal.ssl.AppInputStream.read(byte[], int, int) @bci=30, line=75 (Compiled frame)
 - java.io.BufferedInputStream.fill() @bci=175, line=218 (Compiled frame)
 - java.io.BufferedInputStream.read1(byte[], int, int) @bci=44, line=258 (Compiled frame)
 - java.io.BufferedInputStream.read(byte[], int, int) @bci=49, line=317 (Compiled frame)
 - com.sun.jndi.ldap.Connection.run() @bci=30, line=808 (Compiled frame)
 - java.lang.Thread.run() @bci=11, line=619 (Interpreted frame)


Thread 675: (state = IN_NATIVE)
 - java.net.SocketInputStream.socketRead0(java.io.FileDescriptor, byte[], int, int, int) @bci=0 (Compiled frame; information may be imprecise)
 - java.net.SocketInputStream.read(byte[], int, int) @bci=84, line=129 (Compiled frame)
 - com.sun.net.ssl.internal.ssl.InputRecord.readFully(java.io.InputStream, byte[], int, int) @bci=21, line=293 (Compiled frame)
 - com.sun.net.ssl.internal.ssl.InputRecord.read(java.io.InputStream, java.io.OutputStream) @bci=32, line=331 (Compiled frame)
 - com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(com.sun.net.ssl.internal.ssl.InputRecord, boolean) @bci=44, line=789 (Compiled frame)
 - com.sun.net.ssl.internal.ssl.SSLSocketImpl.readDataRecord(com.sun.net.ssl.internal.ssl.InputRecord) @bci=15, line=746 (Compiled frame)
 - com.sun.net.ssl.internal.ssl.AppInputStream.read(byte[], int, int) @bci=30, line=75 (Compiled frame)
 - java.io.BufferedInputStream.fill() @bci=175, line=218 (Compiled frame)
 - java.io.BufferedInputStream.read1(byte[], int, int) @bci=44, line=258 (Compiled frame)
 - java.io.BufferedInputStream.read(byte[], int, int) @bci=49, line=317 (Compiled frame)
 - com.sun.jndi.ldap.Connection.run() @bci=30, line=808 (Compiled frame)
 - java.lang.Thread.run() @bci=11, line=619 (Interpreted frame)

完整的Threaddump是@ https://docs.google.com/document/d/16YnK85jrlxvu_PpQrTQxtIWjWmAlt8AF1ddAOzvisCM/edit?usp=sharing

2 个答案:

答案 0 :(得分:2)

Java有点像C ++的包装语言。一些库仍然使用c ++并使用java关键字native。

这基本上意味着他们调用了一个现在以c / c ++代码执行的本机方法。

答案 1 :(得分:1)

阻止线程从LDAP服务器通过SSL读取。查看堆栈跟踪。