-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.library-iotype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)
Description
Simple test case
import "dart:io";
import "dart:async";
void main() {
HttpServer
.bind(InternetAddress.ANY_IP_V4, 8081)
.then((server) {
server.autoCompress = true;
server.listen((HttpRequest request) async {
if (request.uri.path == "/q") {
await socket(request);
} else {
request
..response.headers.contentType = ContentType.HTML
..response.write('<html><body>Hello, world!'
'<script type="text/javascript">'
'var ws = new WebSocket("ws://"+window.location.host+"/q");'
'ws.onopen = function() {console.log("open");};'
'</script>'
'</body></html>');
}
request.response.close();
});
});
}
Future socket(HttpRequest request) async {
return WebSocketTransformer.upgrade(request)
.then(handleWebSocket);
}
void handleWebSocket(WebSocket socket){
print('handleWebSocket');
socket.listen(_onSocketData, onDone: _onSocketDone);
}
void _onSocketData(data) {print(data);}
void _onSocketDone() {print('_onSocketDone');}
Server RES
66080
133060
147224
193972
193932
224692
245348
256536
278660
259632
261072
281472
261316
263444
266912
266896
287424
287484
288996
304852
345812
347388
358788
At each run, I opened 100 browser tabs and then close them all. Also, before checking memory use, I ran GC first.
sgehrman
Metadata
Metadata
Assignees
Labels
area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.library-iotype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)