Project

General

Profile

Actions

Bug #2443

closed

Websockets and WPaintedWidget

Added by Bogdan Cosescu about 11 years ago. Updated about 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
11/20/2013
Due date:
% Done:

0%

Estimated time:

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

WtLeak.zip (18.3 KB) WtLeak.zip Bogdan Cosescu, 11/27/2013 05:05 PM
Actions #1

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

Actions #2

Updated by Bogdan Cosescu almost 11 years ago

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.

Actions #3

Updated by Koen Deforche almost 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

Actions #4

Updated by Koen Deforche about 10 years ago

  • Status changed from Feedback to Closed
Actions

Also available in: Atom PDF