1

Recently I often encounter situations where the CPU reaches 100%, So I checked the CPU situation: enter image description here enter image description here enter image description here

It seems that the memory is full, so I dumped heap, and try to analyze it using MAT.

I first noticed that the memory of Finalizer is very abnormal, used more than 2G of memory.

enter image description here

For comparison, it is about 500MB under normal circumstances. I initially thought it was because the Finalizer thread was blocked, But Java thread dump: BLOCKED thread without "waiting to lock ..." seems to mean that this is not the source of the problem


"Finalizer" #3 daemon prio=8 os_prio=0 tid=0x00007f83c008c000 nid=0x1c190 waiting for monitor entry [0x00007f83a1bba000]
   java.lang.Thread.State: BLOCKED (on object monitor)
    at java.util.zip.Deflater.deflateBytes(Native Method)
    at java.util.zip.Deflater.deflate(Deflater.java:444)
    - locked <0x00000006d1b327a0> (a java.util.zip.ZStreamRef)
    at java.util.zip.Deflater.deflate(Deflater.java:366)
    at java.util.zip.DeflaterOutputStream.deflate(DeflaterOutputStream.java:251)
    at java.util.zip.DeflaterOutputStream.write(DeflaterOutputStream.java:211)
    at java.util.zip.GZIPOutputStream.write(GZIPOutputStream.java:145)
    - locked <0x00000006d1b32748> (a java.util.zip.GZIPOutputStream)
    at org.apache.coyote.http11.filters.GzipOutputFilter.doWrite(GzipOutputFilter.java:72)
    at org.apache.coyote.http11.Http11OutputBuffer.doWrite(Http11OutputBuffer.java:199)
    at org.apache.coyote.Response.doWrite(Response.java:538)
    at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:328)
    at org.apache.catalina.connector.OutputBuffer.flushByteBuffer(OutputBuffer.java:748)
    at org.apache.catalina.connector.OutputBuffer.realWriteChars(OutputBuffer.java:433)
    at org.apache.catalina.connector.OutputBuffer.flushCharBuffer(OutputBuffer.java:753)
    at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:284)
    at org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:261)
    at org.apache.catalina.connector.CoyoteOutputStream.flush(CoyoteOutputStream.java:118)
    at javax.imageio.stream..close(FileCacheImageOutputStream.java:238)
    at javax.imageio.stream.ImageFileCacheImageOutputStreamInputStreamImpl.finalize(ImageInputStreamImpl.java:874)
    at java.lang.System$2.invokeFinalize(System.java:1270)
    at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:98)
    at java.lang.ref.Finalizer.access$100(Finalizer.java:34)
    at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:210)

Following all the way, I think I found the object that takes up memory: enter image description here enter image description here enter image description here So it seems that URLJarFile creates a lot of unused buffers, but I don’t know how to continue to find the source of the problem after I get here. Maybe I need to monitor the stack calling here?

Add: I think I found some useful information, most of which are loaded with jstl-1.2.jar enter image description here

0 Answers0