Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Memory leaks

  1. #1

    Default Memory leaks

    I am wondering how can i discover memory leaks?
    The reason for that is that when starting the system it takes about 300-350 MB of memory. After running some applications and going back to the "starting point" (same applications running after a restart) my system is using 750 MB.

    The weird thing is that all the applications as noted from task manager don't use more than normally (also the shared memory didn't increase). There is some memory used somewhere but it doesn't show up at all, is that some applications misbehaving and not letting the unused memory go and that is the reason why it doesn't show up as an application using that "invisible" memory?
    How does a linux geek make love??

    - rtfm; unzip; strip; touch; finger; mount; fsck; more; yes; umount; zip; sleep;

  2. #2

    Default Re: Memory leaks

    Valgrind is the tool I've seen mentioned but can't give you any assistance above my pay grade
    Man first, have a try at Info, have a look at Wiki, if all that fails Scroogle!!!!!
    If I've helped click on the Rep button I don't know what it does but it sounds cool.

  3. #3

    Default Re: Memory leaks

    Mmm didn't read that correctly I suspect your best bet would be htop and sort by mem. Similar can be done with top, by pressing F then n. Though to make it useful you may need to W(write a configuration after sorting and setting number of tasks to greater than running). Then running with top -b -n 1 > tasks-sorted.txt

    Man top and ? inside top.
    Man first, have a try at Info, have a look at Wiki, if all that fails Scroogle!!!!!
    If I've helped click on the Rep button I don't know what it does but it sounds cool.

  4. #4

    Default Re: Memory leaks

    It was helpful but what i mean is that i suspect some applications allocating memory and then not disallocating? Like new() and delete() in c++.
    How does a linux geek make love??

    - rtfm; unzip; strip; touch; finger; mount; fsck; more; yes; umount; zip; sleep;

  5. #5

    Default Re: Memory leaks

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    How are you determining you are losing memory? Are you familiar with the
    concepts around caching that the OS does by default? This has come up
    several times in the various Linux forums (including this one I imagine)
    about how 'Used' memory is still available because it is used to cache
    data that may be used later but which can be dropped in a nanosecond if
    needed. Post the output from 'free' before/after as you mentioned you
    were doing your comparisons.

    Good luck.




    BenderBendingRodriguez wrote:
    > It was helpful but what i mean is that i suspect some applications
    > allocating memory and then not disallocating? Like new() and delete() in
    > c++.
    >
    >

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v2.0.9 (GNU/Linux)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

    iQIcBAEBAgAGBQJKUlFwAAoJEF+XTK08PnB5zMAQANbbxYeA+90BrbsiWyv0JrJC
    VXd4P5uURJJZe514/d2aj2jip9S2izcX4PwnzwVt5WDqypNy5PbP8dgjmJ9a/tuR
    eo11/13TSi4EioVj1GUWJJv9AAG/JWut2dQdonbwYx9MotdsynoLRc4LaE6nX4ZF
    ShT+4+jyWxnJvbUQrAV5TXXZyWSpmBulaQWcBcAWsuFdXBJUVLJ0x+fFRjqiK6hJ
    0jOxfWf1Ery77naa7U0tg+RSt6rkXeVmoE7dGYj/7glNFJ0oB5FZwf0xPjZwhN8i
    rnUoEYwiFEJU6IJMbbq6DyBo9hUmk2DwfXwdzua07zk/itdC/QcWilr3eItpBjwL
    ZP+5YR0Mby4lNnDP+MY3t101/MxCFEGj/E2loQHJZuIRb2gGubFCfu1WkuZ4GaVW
    VgqspJ+WmPdAF/Bz8HIdu3V5CFjrRRt21qJzrRRZiu5YUlAVr5nlbF6BAKr4i0je
    DBNdu1fuaFFL9mf6r3U0aBU3zjFHcInkD6qnjAbng7Lh1Ij4fzOujNAD7ItJlV5e
    y4TqoHeqa6w5JFUvwIuX64MjZshH/SSTFm1MOILSmeg4iObnac7BnPsKuYsxmjnM
    clBm600IdKklao3q+OrsRobhubhyOWZn8I0MdwNbbqS4c/Ce7QyW1KYp+uV2uql8
    HGPV6E1e195vopOXNtZk
    =radn
    -----END PGP SIGNATURE-----

  6. #6

    Default Re: Memory leaks

    I am completely aware how caching works (that's why i have 8GB of memory ).

    Both task manager and a memory monitoring widget reports used memory (if i am aware then it does not count the cached memory) so just after a restart the system uses about 300-350 MB of memory (that's what system monitor and memory widget reports). After some time using some applications it is using a lot more than that using the same apps that were running after restart. The memroy usage of those apps is no different all the times BUT as a fact system reports A LOT more memory being used (to say again, the same set of apps doesn't use more memory than earlier). Is it possible that some applications allocate some memory in ram and then when closing forget about releasing that allocated memory? Maybe that's the kernel's memory usage which i guess is not reported?
    How does a linux geek make love??

    - rtfm; unzip; strip; touch; finger; mount; fsck; more; yes; umount; zip; sleep;

  7. #7

    Default Re: Memory leaks

    Well using htop/top will give you better breakdown than some gui widget...

    But I concur with ab you've yet to confirm whether it is real memory usage free used-cached-buffers=footprint. But with top you can sort it via shared virtual or resident etc..
    Man first, have a try at Info, have a look at Wiki, if all that fails Scroogle!!!!!
    If I've helped click on the Rep button I don't know what it does but it sounds cool.

  8. #8

    Default Re: Memory leaks

    Does

    echo 3 > /proc/sys/vm/drop_caches

    help?

    Drop Caches - linux-mm.org Wiki

  9. #9

    Default Re: Memory leaks

    It did but only by a little margin, there is still difference of about 200MB between clean restart and after using some apps.
    How does a linux geek make love??

    - rtfm; unzip; strip; touch; finger; mount; fsck; more; yes; umount; zip; sleep;

  10. #10

    Default Re: Memory leaks

    I can see that sysinfo shows about 7GB of caches, that is great. You insist about no possible memory leaks as if it was impossible in linux.
    free gives me this right now.
    total used free buffers cached
    Mem: 8180000 796716 7383284 2876 206236

    Later on cached will be like 7GB or something but after restart cached will be again low and used will be even lower with the same apps running.
    How does a linux geek make love??

    - rtfm; unzip; strip; touch; finger; mount; fsck; more; yes; umount; zip; sleep;

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •