Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
CometD connect calls are causing OOM #794
After upgrading, few cometd connect calls started taking more than a minute to respond and responded without any data. After enabling cometd DEBUG logs, we realized that when the application returns a large amount of data ( usually more 500KBs ) in the response of connect calls, connect calls don't go to AsyncJSONTransport.State.COMPLETE and it is leading to memory leak and causing the application to go out of memory.
Any idea, how this issue can be fixed?
You should, it's a major release change.
As for the rest, there is too little detail to understand what's going on. 500 KiB of messages is not too much and especially if you're using
Like often happens, I think you have a problem in the client, that cannot keep up with the speed the server is sending data. The server will start sending data, the client will consume it too slowly, the TCP connection becomes congested and eventually the client is too overwhelmed and the connection times out.
I doubt CometD is causing any memory leak, it's been tested in very hard conditions (I'm guessing far harder than yours) and runs for months without issues.
If you have a memory leak, take a heap dump and analyze it.
In summary, I think your problems are within your application, not CometD.
If you have evidence that the problem is in CometD, please attach the evidence here - but look hard in your application first.