当前位置 : 主页 > 编程语言 > java >

刷新jsp文件时的线程锁定

来源:互联网 收集:自由互联 发布时间:2021-06-25
在重负载下,我看到在GZipping和解压缩JSP文件时许多线程被锁定. 线程转储如下所示.似乎来自“header.jsp”,大小为14Kb. “http-0.0.0.0-8080-304”守护进程prio = 3 tid = 0x0000000008bcc000 nid = 0x302 run
在重负载下,我看到在GZipping和解压缩JSP文件时许多线程被锁定.
线程转储如下所示.似乎来自“header.jsp”,大小为14Kb.

“http-0.0.0.0-8080-304”守护进程prio = 3 tid = 0x0000000008bcc000 nid = 0x302 runnable [0xfffffd7de7bc2000]
   java.lang.Thread.State:RUNNABLE
    at java.util.zip.Deflater.deflateBytes(Native Method)
    在java.util.zip.Deflater.deflate(Deflater.java:306)
     – 已锁定< 0xfffffd7e589078e8> (java.util.zip.ZStreamRef)
    at java.util.zip.DeflaterOutputStream.deflate(DeflaterOutputStream.java:159)
    at java.util.zip.DeflaterOutputStream.write(DeflaterOutputStream.java:118)
    at java.util.zip.GZIPOutputStream.write(GZIPOutputStream.java:72)
     – 已锁定< 0xfffffd7e58524d28> (java.util.zip.GZIPOutputStream)
    at java.util.zip.DeflaterOutputStream.write(DeflaterOutputStream.java:91)
    在com.pinksheets.common.web.cache.ServletOutputStreamWrapper.write(ServletOutputStreamWrapper.java:24)
    在java.io.OutputStream.write(OutputStream.java:99)
    at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:202)
    at sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:263)
    at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:106)
     – 已锁定< 0xfffffd7e58524d48> (java.io.OutputStreamWriter)
    at java.io.OutputStreamWriter.write(OutputStreamWriter.java:190)
    在java.io.BufferedWriter.write(BufferedWriter.java:170)
     – 已锁定< 0xfffffd7e58524d48> (java.io.OutputStreamWriter)
    在java.io.PrintWriter.write(PrintWriter.java:382)
     – 已锁定< 0xfffffd7e5824bd80> (一个java.io.BufferedWriter)
    在org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:119)
    在org.apache.jasper.runtime.JspWriterImpl.write(JspWriterImpl.java:326)
    at org.apache.jasper.runtime.JspWriterImpl.write(JspWriterImpl.java:342)
    在org.apache.jsp.include.header_jsp._jspService(header_jsp.java:2032)
    在org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    在javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

一些推论链接:

> http://www.java.net/forum/topic/glassfish/glassfish/glassfish-301-gzip-problem-threads-apparently-spinning-100-cpu-use
> java.util.zip – ZipInputStream v.s. ZipFile

我们遇到了类似的问题 – 到目前为止,我们最好的理论是Java代码(或者它使用底层zlib支持库的方式)可以使线程以这种方式旋转到空间.到目前为止,我们能够阻止它的唯一方法是不使用GZip响应 – 但我们宁愿支付100%的CPU成本(因为其他线程仍然高度响应)而不是GZIP它们.你发布已经好几个月了;你还有其他信息要分享吗?

网友评论