Hi Folks We ran into what looks like a memory leak in tomcat 8.5.57 on Ubuntu 18.04 running on Openjdk 11.0.5
Our app maintains permanent websocket connections with multiple clients (also written in Java, using the Tyrus websocket client - version 1.13.1). Recently, a few clients began misbehaving. They're opening multiple websocket sessions in parallel which our app doesn't allow. When this happens, the app closes the previous websocket session and starts talking to the client over the new one session exclusively. This issue happened to two of our clients that have a bunch of network connectivity issues which somehow triggered this behavior. However, I'm not here to debug the misbehaving clients, the client issue is being investigated in parallel. However, it appears that this behavior triggered a memory leak in tomcat. Slowly but surely our heap keeps filling up with byte arrays that seem to have come from the misbehaving clients (we know this from the contents of the arrays). Below are the paths to the gc roots for a few of these arrays that contain data from one such client. The heap dump was taken *over an hour after the client was blocked by its IP address using iptables*. So we believe there's no reason for these buffers to still exist in memory. Please note that the path to the GC roots are all inside tomcat, our app is nowhere to be found. We would appreciate any guidance or suggestions. Thanks! [image: image.png] [image: image.png] [image: image.png]