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 8824749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:42:40+00:00 2026-06-14T06:42:40+00:00

For the sake of demonstration, I have created this simple console application: #include <iostream>

  • 0

For the sake of demonstration, I have created this simple console application:

#include <iostream>

class Person {
public:
    int mAge;
};

int main(int argc, const char * argv[])
{
    Person *iPerson = new Person();
    iPerson->mAge = 15;

    std::cout << "Age: " << iPerson->mAge;
    return 0;
}

Now I’m aware that Valgrind and CPP Check will identify leaks here, but testing Apple’s Instruments, When I profile this code I can’t see any leaks. This is despite iPerson never being deleted.

  • 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-06-14T06:42:42+00:00Added an answer on June 14, 2026 at 6:42 am

    Leaks Instrument performs snapshots at a predefined frequency. By default, that value is “every 10 seconds”. You program completes before 10 seconds. Thus, the leak is never collected. So you must suspend execution after iPerson has gone out of scope in order for that leak to be detected. Also, if you just add a sleep while that pointer is still referenced on the stack or in a register, then it won’t be a leak.

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

Sidebar

Related Questions

For the sake of argument, here's a simple person class public class Person :
For the sake of argument I have Person Objects public class Person { public
For the sake of this question, here is my generic class. [ComVisible(true)] public class
for sake of simplicity: public class Person { String name; Set<Address> addresses; } public
For the sake of simplicity, let's say I have a Person class in Python.
For simplicity's sake, lets say I have the following Abstract Base Controller Class: public
This question is just for a sake of knowledge. I don't have any practical
For simplicity's sake, let's say we have this rather contrived table: [ID] [Weekday] [Weather]
I have an array which for arguments sake looks something like this: a =
For sake of a simple example, I'd like to have a list of strings.

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.