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

  • SEARCH
  • Home
  • 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 7810931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T03:58:17+00:00 2026-06-02T03:58:17+00:00

I have a question about the memory. According to the code & log below,

  • 0

I have a question about the memory. According to the code & log below, is 0x6868190 a leak?

Code:

self.point = [NSString stringWithFormat:@"R"];
NSLog(@"********First********%d",[point retainCount]);
NSLog(@"********First********%p",point);
self.point = [NSString stringWithFormat:@"A"];
NSLog(@"********Second********%d",[point retainCount]);
NSLog(@"********Second********%p",point);

Log:

 2012-04-17 20:27:49.838 test_[297:f803] ********First********2
 2012-04-17 20:27:49.838 test_[297:f803] ********First********0x6868190
 2012-04-17 20:27:49.839 test_[297:f803] ********Second********2
 2012-04-17 20:27:49.839 test_[297:f803] ********Second********0x6879500
  • 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-02T03:58:18+00:00Added an answer on June 2, 2026 at 3:58 am

    Use Instruments to check for memory leak. The fact that the retain count isn’t zero (or I guess you were expecting 1) doesn’t necessarily mean there is a leak. Those objects will be released at the end of the run loop if necessary.

    The stringWithFormat call creates an object with a retain count of 1 (which will be auto-released). Then your property is probably declared as retain/strong, which adds one that will be released when your main object is released. Therefore it is two.

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

Sidebar

Related Questions

I'm developing an iPhone app and have a question about memory management. Let's say
I have a question about structure padding and memory alignment optimizations regarding structures in
I have a question about best practices with the Module Design Pattern. The code
Let's make it immediately clear: this is not a question about memory leak! I
I have question about pointers in C. Each pointer has 4 bytes in memory
I have a question about why I can access certain pieces of memory, and
I have theoretical question about OSGi memory management. Let’s say we have some OSGi
I have a question about the memory management. In my app delegate, I have
I'm new to MySQL, and I have a question about the memory. I have
I have a question about the virtual memory in Python. When the process is

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.