-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Websocket memory leak #26660
Comments
Do you see this memory leak also in dart2js compiled code? |
Same leak occurs with dart2js compiled code, tested in chrome. I will work on updating Dart to check. |
Getting the same issue in Dart 1.17.0 |
Thanks for testing. Note: zones, from /cc @rakudrama |
It appears as though I am not running inside of a zone and I am not using Angular. As far as the repro:
Which manipulates a Websocket member variable to the class running the webpage functionality. I have pretty much isolated the code to opening the websocket and then listening on the websocket. Open stream is invoked when a button on the page is clicked and just signals for more packets to be received. |
Dartium is expected to leak a significant amount of memory and is only intended as a development tool. Dart2js should not leak memory. |
Just tested with Dart2js again to be sure and still have the leak. The leak seems to be about equal to my packet size coming across the wire if that helps troubleshoot at all. |
It looks like it is garbage collecting when compiling with Dart2js, it just allows the memory to climb ~500MB before it collects. I wasn't hitting that threshold with my original streaming rate so it looked like the same leak that would make Dartium run up to ~1.3GB and then crash. Thank you guys for the help. |
I am getting a memory leak listening on a websocket. The only time I don't leak memory is when I am not creating a parameter to send to the onMessage handler. What I have tried:
ws.onMessage.listen((MessageEvent e) {});
ws.onMessage.listen((MessageEvent e) { e = null});
I attempt to invoke the garbage collector by setting e to null, but I am guessing another reference exists within the Stream.
The issue persists regardless of what I attempt to receive over the socket. It also persists when the websocket's binary type is default or set to arrayBuffer.
Dart version 1.14.2
Dartium version 1.14.2.0
The text was updated successfully, but these errors were encountered: