java.lang.OutOfMemoryError: requested 1958536 bytes for Chunk::new. Out of swap space

后端 未结 3 894
半阙折子戏
半阙折子戏 2020-12-16 22:23

We are facing the below problem at our production enviournment in unpredictable manner sometimes the server is down in a day or sometimes in a week, below is the exact error

3条回答
  •  天命终不由人
    2020-12-16 22:54

    As stated by the other answers / comments, you are running out of memory. Given your JVM settings, I'd say that the root cause is 99% likely to be a memory leak.

    If you have been doing a lot of hot loading in the Tomcat instance, this could just be caused by that. Hot loading is notorious for leaking memory, and there is not much you can do about it in practice ... except exit and restart your Tomcat more often.

    The other possibility is that your application is leaking memory. If this is the case then you will need to use a memory profiler to track down the leak.

    The fact that the OOME caused a JVM crash is interesting, but probably not significant. (It looks like the JVM was trying to JIT compile a class generated from a JSP when it ran out of memory. The chunk being requested is rather large, but that probably means you have a rather large / complicated JSP.)

提交回复
热议问题