Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7674491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:44:57+00:00 2026-05-31T16:44:57+00:00

I want to check a long running process for memory leaks with valgrind. I

  • 0

I want to check a long running process for memory leaks with valgrind. I suspect the memory leak I’m after might happen only after several hours of execution. I can run the app under valgrind and get the valgrind log just fine, but doing so means I have to quit the application and start it again anew for a new valgrind session for which I would still have to wait several hours. Is it possible to keep valgrind and the app running and still get valgrind’s (partial) data at any point during execution?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T16:44:58+00:00Added an answer on May 31, 2026 at 4:44 pm

    You can do that by using the Valgrind gdbserver and GDB.

    In short, you start your program with valgrind as usual, but with the --vgdb=yes switch:

    $ valgrind --tool=memcheck --vgdb=yes ./a.out 
    

    In another session, you start gdb on the same executable, and connect to valgrind. You can then issue valgrind commands:

    $ gdb ./a.out
    ...
    (gdb) target remote | vgdb
    ....
    (gdb) monitor leak_check full reachable any
    ==8677== 32 bytes in 1 blocks are definitely lost in loss record 1 of 2
    ==8677==    at 0x4C28E3D: malloc (vg_replace_malloc.c:263)
    ==8677==    by 0x400591: foo (in /home/me/tmp/a.out)
    ==8677==    by 0x4005A7: main (in /home/me/tmp/a.out)
    ==8677== 
    ==8677== 32 bytes in 1 blocks are definitely lost in loss record 2 of 2
    ==8677==    at 0x4C28E3D: malloc (vg_replace_malloc.c:263)
    ==8677==    by 0x400591: foo (in /home/me/tmp/a.out)
    ==8677==    by 0x4005AC: main (in /home/me/tmp/a.out)
    ==8677== 
    ==8677== LEAK SUMMARY:
    ==8677==    definitely lost: 64 bytes in 2 blocks
    ==8677==    indirectly lost: 0 bytes in 0 blocks
    ==8677==      possibly lost: 0 bytes in 0 blocks
    ==8677==    still reachable: 0 bytes in 0 blocks
    ==8677==         suppressed: 0 bytes in 0 blocks
    ==8677== 
    (gdb) 
    

    See the manual for a list of commands, here for memcheck.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want a script to start and interact with a long running process. The
I want to start a potentially long running background process from Delphi. I want
i need to convert pointers to long (SendMessage()) and i want to safely check
I've got a long running python script that I want to be able to
I got a long running program that I don't want to kill, but I
I have a long running loop I want to run in the background with
What I have is NSTask running a long premade shell script and I want
I'm designing a long running process, triggered by a Django management command, that needs
I want to check how long time my program takes. Then I using /usr/bin/time
I have a long running ASP response (actually an MVC action) that I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.