Bug #2443
closedWebsockets and WPaintedWidget
0%
Description
Hi guys!
I have an app that paints a lot of images on a canvas. I activated websocket on version 3.3.1 and I noticed at the browser(Chrome and Firefox, latest versions) that the memory increases up to 4Gb and the tab crashes.
On long polling there is no increase in memory.
Files
Updated by Koen Deforche about 11 years ago
- Status changed from New to InProgress
- Assignee set to Koen Deforche
Hey,
That sounds like a bug. If you could make a small test case we'll get at this sooner than later.
Regards,
koen
Updated by Bogdan Cosescu about 11 years ago
- File WtLeak.zip WtLeak.zip added
Hi Koen!
Just made a WT app to help you.
I'll describe it since it's modelling my current architecture.
So, I'm using server push updates from a thread in WApplication object which at 30ms will trigger an update.
The update will draw on canvas 150 images all of 80x135 dimension. There are a total of 10 predefined images that are being used in random.
On my machine I noticed on Chrome that the tab memory was increasing and after a while the crashed.
Updated by Koen Deforche about 11 years ago
- Status changed from InProgress to Feedback
Hey,
Thanks for the test case. This is actually something that is not entirely unexpected. When using Ajax, we have some built-in throttling which is based on having only a single request/response on the wire. The motivation for this is that we do not want to risk reordering of requests/responses (Ajax calls aren't guaranteed to run over the same connection), and this also prevents the browser/server from flooding each-other.
With WebSockets enabled, we do not implement this throttling from the server to client. In your case the server is really flooding the client. Wt will postpone rendering (which triggers the paintEvent() of WPaintedWdigets) as long as there is outstanding input from the client, but I'm not sure if you could use this to your advantage in your setup. I believe the only way to fix this situation is to include some kind of communication from client to server which indicates if it is keeping up or not without putting too be a limitation on the update rate in high latency networks.
Regards,
koen
Regards,
koen
Updated by Koen Deforche about 10 years ago
- Status changed from Feedback to Closed