Is this a memory leak?

  • Hi,

    i'm working on an Qt project wit 4.8.5 on an small ARM5 device.

    My valgrind check did not report any memory leaks but if i check the free memory at the device with "top" I see the value decreasing every ~1Minute with 28k?

    If my application is not running the free memory is const.

    The "top" is showing a constant VSZ value for my app. Only the free mem is going less....

    Is it possible that qt will free this memory if necessary or is this a job from the linux?

    Thank you

  • Hi @Ferdl, and welcome :)

    At a guess, I'd say this is not memory that Qt is holding onto, but rather some sort additional memory utilisation being done by the kernel for system optimization (not necessarily for your app). Consider, for example, that any truly free / empty RAM is wasted RAM, in that the kernel can always be using it to cache things :)

    Anyway, I'd try looking at something like the output of:

    cat /proc/meminfo

    to get a more specific idea of where the memory is going. But at this stage, it doesn't sound like anything to worry about... yet... ;)

  • thanks Paul for this tip

    I checked the meminfo and compared two readouts after a few minutes:

    MemTotal: 117768 117768
    MemFree: 40908 40544
    MemAvailable: 87776 87800
    Buffers: 17716 18096
    Cached: 30152 30156
    SwapCached: 0 0
    Active: 22532 23144
    Inactive: 42628 42404
    Active(anon): 17492 17500
    Inactive(anon): 304 300
    Active(file): 5040 5644
    Inactive(file): 42324 42104
    Unevictable: 0 0
    Mlocked: 0 0
    SwapTotal: 0 0
    SwapFree: 0 0
    Dirty: 56 0
    Writeback: 0 0
    AnonPages: 17320 17324
    Mapped: 13424 13424
    Shmem: 504 504
    Slab: 7564 7568
    SReclaimable: 4628 4632
    SUnreclaim: 2936 2936
    KernelStack: 464 464
    PageTables: 488 488
    NFS_Unstable: 0 0
    Bounce: 0 0
    WritebackTmp: 0 0
    CommitLimit: 58884 58884
    Committed_AS: 78844 78844
    VmallocTotal: 892928 892928
    VmallocUsed: 964 964
    VmallocChunk: 876444 876444

    the main difference I see is the Active and Inactive (anon and file) values.

    I will search for some explanation for that meaning..... I think you are right actually it looks ok....
    please corect me if I'm wrong :)

    have a good day

Log in to reply

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