Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.13, 5.14.2, 5.15.1
-
0807f16eb407eaf8a5b34b67602d0a97778d945d 1c6d6cbb62c5e93cbcad2d740c3b0ed01095618c
Description
When running the attached test code, there appears to be a memory leak in QNetworkAccessManager, as the longer the program runs, the greater the memory usage (eventually running into std::bad_alloc OOM exceptions if left long enough on a machine with no swap file or a 32-bit address space). Two 88-byte QObjectPrivate::Connection structures are created per GET request that are not freed until the QNetworkAccessManager itself is destructed. This is causing issues in a long-running service that makes many thousands of HTTP requests over the course of days, slowly eating away at the machine's available RAM, eventually crashing as it exhausts its heap address space (in a 32-bit setting).
(In this test reproduction, localhost:8000 is simply running an HTTP server that serves a small static file in response.)
The relevant stack traces from valgrind that show the memory leak are also attached. (Deleting the global QNetworkAccessManager object causes these objects to be freed.)
Attachments
Issue Links
- depends on
-
QTBUG-88248 QObject orphaned connections soft-leak
- Closed
- is duplicated by
-
QTBUG-88560 Memory leak on QNetworkAccessManager post function
- Closed
For Gerrit Dashboard: QTBUG-88063 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
320610,2 | QNAM: Work around QObject finicky orphan cleanup details | 5.15 | qt/qtbase | Status: MERGED | +2 | 0 |
320682,3 | QNAM: Work around QObject finicky orphan cleanup details | dev | qt/qtbase | Status: MERGED | +2 | 0 |