Websocket server is crashing after sending a lot of incremental data

220 Views Asked by At

I am using Grizzly framework with their built in Websockets. I have a response that sends a large string, almost 900k characters per send. This response will send 11 times before closing the socket. This will be almost 10 million characters before the socket closes.

When I do about 3 of these requests, my server just stops without throwing any errors. I am not quite sure what is going on here, why would it just stop? I am creating a new socket each time so I don't see how this could be some sort of buffer overflow error. Thoughts?

Edit: It seems like this is a memory problem. When I increased the JVM heap, my request is going much further without crashing. I'm not storing any of these strings. Maybe the send is caching it somewhere?

0

There are 0 best solutions below