I have an application that runs multiple client socket connections. I've noticed that when I send thousands of messages simultaneously, it occasionally generates a memory leak. What could it depend on? Could it be a network problem? Bottleneck?
I'll try to slow down the process of a single message but it is a workaround.
A note: when I run a command GC manually then Garbage Collector frees the memory otherwise it grows constantly.
Thanks in advance.
I found that I was getting memory leaks when using
spring-websocket. I'm not sure if the issue was with spring or with tomcat.I ended up switching to
spring-webfluxwhich usesnettyunder the hood. I haven't had any issues since the move tospring-webflux. Note that the API's are quite different forwebfluxwhich uses reactive streams.