Monitoring memory of child processes

brian_nucklesbrian_nuckles Posts: 32 admin
edited March 2019 in Insure++

Sometimes a project depends or starts another process to be executed as a dependency. You can instrument the applications with Insure++ and then run the main executable with Insure++ and still be able to have Insure++ detect memory
leaks from the child process(s). By doing this, you can find memory leaks occurring when the child process is being executed and can show you where a memory leak will be produced from the applications execution.

To run Insure++ with a child process, please run the following the steps:

  1. Open your Visual Studio under administrator mode
  2. Once Visual Studio is opened as administrator, instrument the entire solution on the main executable and the executable that will be a child process.

  3. After the project is instrumented, open a terminal as Adminstrator.

  4. Go to the directory were the instrumented exectuables were made
  5. Run the following command line:
    inject.exe -children createChildProcess.exe


    inject.exe -children createChildProcess.exe C:\projects\theAppToBeCalled.exe "Test1 Test2 Test3 Test4"

The inject.exe option runs Insure++ integrated with the InsureSpy debugger and specifically this option is best for console builds using the command line. The -children flag is used to tell Insure++ to detect memory leaks from the
child process. Without the -children flag Insure++ will not inspect the child process running for memory leaks.

There are more details in the documentation for Insure++ on these commands located in the following link:

A sample project is also available as an attachment to this post.

Sign In or Register to comment.