gpt4 book ai didi

jsp - 刷新jsp文件时线程锁定

转载 作者:行者123 更新时间:2023-12-04 15:36:47 28 4
gpt4 key购买 nike

在重负载下,我看到很多线程在 GZipping 和解压缩 JSP 文件时被锁定。
线程转储如下所示。似乎来自大小为 14Kb 的“header.jsp”。

http-0.0.0.0-8080-304" daemon prio=3 tid=0x0000000008bcc000 nid=0x302 runnable [0xfffffd7de7bc2000]
java.lang.Thread.State: RUNNABLE
at java.util.zip.Deflater.deflateBytes(Native Method)
at java.util.zip.Deflater.deflate(Deflater.java:306)
- locked <0xfffffd7e589078e8> (a 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)
- locked <0xfffffd7e58524d28> (a java.util.zip.GZIPOutputStream)
at java.util.zip.DeflaterOutputStream.write(DeflaterOutputStream.java:91)
at com.pinksheets.common.web.cache.ServletOutputStreamWrapper.write(ServletOutputStreamWrapper.java:24)
at 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)
- locked <0xfffffd7e58524d48> (a java.io.OutputStreamWriter)
at java.io.OutputStreamWriter.write(OutputStreamWriter.java:190)
at java.io.BufferedWriter.write(BufferedWriter.java:170)
- locked <0xfffffd7e58524d48> (a java.io.OutputStreamWriter)
at java.io.PrintWriter.write(PrintWriter.java:382)
- locked <0xfffffd7e5824bd80> (a java.io.BufferedWriter)
at org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:119)
at org.apache.jasper.runtime.JspWriterImpl.write(JspWriterImpl.java:326)
at org.apache.jasper.runtime.JspWriterImpl.write(JspWriterImpl.java:342)
at org.apache.jsp.include.header_jsp._jspService(header_jsp.java:2032)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at 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 它们。你发帖已经几个月了;你还有其他信息要分享吗?

    关于jsp - 刷新jsp文件时线程锁定,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6584765/

    28 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com