Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.14.0 RC2
-
None
-
Tested on Ubuntu 20.19 and Ubuntu 20.20
Description
When creating an instance of an XMLHttpRequest, the garbage collector does not clear the memory after all references to it have disappeared. Calling `gc()` will not collect the memory neither. First documented in [this question on stack overflow|https://stackoverflow.com/questions/61378389/qml-memory-leak-sending-xmlhttprequest.]
Example code:
import QtQuick 2.12 import QtQuick.Window 2.12 Window { visible: true width: 640 height: 480 Component.onCompleted: { for(var i = 0; i < 100000; i++) { console.log("Send request " + i) var xhttp = new XMLHttpRequest xhttp.open('get', 'someurl') xhttp.send() delete xhttp } gc() //why won't this clean the instances of XMLHttpRequest??? } }
Running this code latches 2134MB of memory, and doesn't release it even after 3h52m: