Unexpected Memory Leak in Windows 10?



  • Hello,

    I have developed a piece of software that has been running without a memory leak for a long time. Without any changes to the software, one of my colleagues noticed a memory leak on his Laptop (Windows 10). It is a new laptop and the only computer with Windows 10 that I have access to.

    I am using Qt 4.8.1 and the executable was statically compiled. It receives high volume data using QUDPSocket, but I have tested this and it has not caused a memory leak before. It runs fine on every other computer I have access to (Windows 7). He is able to run it without a leak while receiving datagrams at a very low message rate. I can't be certain this is where the memory leak occurs, but it seems the most likely to me.

    Does anyone know anything about issues regarding QUDPSocket in Windows 10? Unfortunately, I don't seem to have access to a profiler and I don't have physical access to his laptop.

    Thanks in advance and please let me know what other information might be useful to find this bug.


  • Qt Champions 2016

    @AnnaB
    Hello,

    Without any changes to the software, one of my colleagues noticed a memory leak on his Laptop (Windows 10).
    ...
    Unfortunately, I don't seem to have access to a profiler and I don't have physical access to his laptop.

    Without a memory analysis tool, how do you know there's a leak?

    He is able to run it without a leak while receiving datagrams at a very low message rate.

    This also sounds strange. Either there's a leak, or there isn't ... how does the message rate factor into that?

    Kind regards.



  • @kshegunov

    Thanks for the reply.

    Without a memory analysis tool, how do you know there's a leak?

    We are looking at the performance window of Window's Task manager. There is a very clear leak that can be seen in the Physical Memory Usage History.

    He is able to run it without a leak while receiving datagrams at a very low message rate.

    This also sounds strange. Either there's a leak, or there isn't ... how does the message rate factor into that?

    I agree this sounds strange, but it appears to me that something is not being handled in a timely manner. We are parsing image data that is received at a rate of about 30 frames per second. We cannot afford to drop data, so if the image data isn't read and displayed in a timely manner, it would make sense that there could be a slow memory leak while the software falls behind processing these messages. We are aware of the the possibility of a memory leak here. (Note that I don't know this what is happening on the Windows 10 computer, I only know it is a possibility on any system). However, my collegue can only receive images at a rate of 5 frames per second . Any higher and there is an obvious memory leak and the program crashes within half a minute or so.


  • Lifetime Qt Champion

    Hi,

    From your description (5 fps instead of 30) it sounds rather like some queue filling up, so technically not a memory leak but for some reason your application can't process data quickly enough. If you can't have access to any tool, you can at least add logging to your application. It might slow it down a bit but at least that could help you find the hotspot on that computer.

    What kind of image are you processing ? What does that processing involve ?

    On a side note, 4.8.1 is pretty old, can you upgrade to 4.8.7 if not Qt 5 ?



  • @SGaist Thanks for your reply. I suppose you're right that it isn't really a memory leak.

    We are processing raw medical images. In the simplest case, we are only receiving, parsing and displaying the image (using OpenGL), as well as overlaying some annotations. I don't think we can do Qt 5, but I've tried 4.8.7 with the same issues.


  • Lifetime Qt Champion

    What size are these images ?

    Are you doing all the processing through OpenGL ?


  • Qt Champions 2016

    @AnnaB
    There's one thing bothering me though ... You said you can't afford to drop a frame, but you use datagrams, which are inherently unsafe (in that manner) ... otherwise I'd assume it's what @SGaist said - probably your processing is lagging behind and there's work queuing up ...


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.