Welcome to the VirtuQ Forums.
Results 1 to 4 of 4
  1. #1

    memory leaks using valgrind

    hi,

    how to check memory leaks in a program using valgrind on lab machine?
    I tried following command but its not working:
    valgrind --leak-check=yes prog_name

    Please help

    Thanks,
    anon10270

  2. #2
    VirtuQ™ Moderator
    Join Date
    Jul 2011
    Location
    Bangalore, India
    Posts
    1,044
    Blog Entries
    2
    Anon10270,

    Please elaborate when you say *not-working*. I guess in your case, valgrind is saying "Command/program not found". That is happening because you need to prefix <my prog> with a ./ to indicate that it is in the current directory, otherwise, valgrind will search in your path and crib in case it cannot locate <my prog>.

    Thanks,

    Anup

  3. #3
    Member
    Join Date
    Feb 2012
    Location
    Noida, India
    Posts
    89
    Sir,

    When can we tell that a memory leak will occur?

    thanks,

  4. #4
    VirtuQ™ Moderator
    Join Date
    Jul 2011
    Location
    Bangalore, India
    Posts
    1,044
    Blog Entries
    2
    Anon10038,

    The question is not clear. You can check in the valgrind log and search for *lost* and *invalid*.

    Thanks,

    Anup


 

Posting Permissions

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