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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T03:44:09+00:00 2026-05-16T03:44:09+00:00

I’m writing an application (basically its yet another iBooks clone) which consumes a lot

  • 0

I’m writing an application (basically its yet another iBooks clone) which consumes a lot of memory. Depending on the input data, it’s memory footprint can go up to 70-80 MB (as MemoryMonitor states) or even more.
It works fine for quite some time, but it tends to increase its memory footprint over time.
So lets say you open a book and application’s memory footprint goes from 6MB up to 60MB. Then what is supposed to happen is that you close the book and memory footprint goes back down to 6MB. And it doesn’t. It goes down to ~30MB (according to MemoryMonitor), which results in a crash in just a few iterations.

Now the interesting part. I’ve tried clang static analyzer, but it shows no problems (apart from pointing at singletons etc).
I’ve tried using leaks instruments, but they show that I only have 2-3KB total (and it should be ~24MB+). Moreover, I’m not concerned that instruments are actually telling me the truth. I’ve double checked all the leaks that instruments report and I’m 99% certain that there are no leaks there.
I’ve tried using allocations instrument, but it shows that after closing the book, memory footprint goes down to 6MB, which is the desired number. But that doesn’t make much sense since if it was the case, application would have never crashed.
I’ve also tried using openglES profiler for Resource Bytes graph, but it also shows no leaking or anything else suspicious.
The only instrument I’ve used to trust was the Memory Monitor, because my application would always crash when it shows ~110MB real memory used. However, a) it doesn’t show what allocates the memory and b) when I tried running it several times with the same application build, I found out that it’s readings differ dramatically from run to run (15-20MB difference while doing exactly the same).

So all the instruments are telling me that my code is fine (apart from Memory Monitor, which appears to be correct but useless for any measuring) but it keeps crushing.
I have no clue what should I do next. I certainly cannot reduce the overall memory footprint anymore, and I cannot find memory leaks (which is still the way to go I guess).

So this are my questions:
1) Is there any way of finding leaks apart from those mentioned above? Another profiler program for iphone maybe?
2) I’ve read about some sort of defragmentation problems, like when you allocate/reallocate many objects and then application doesn’t return freed blocks back to OS, which may can make it impossible to allocate big block of memory just because it is too fragmented and OS doesn’t give you any more memory. I’ve never seen a good topic about that through. If anyone could spare a link to a related topic, that would be awesome.
3) I’ve tried disabling several parts of the program, and so far it looks like the whole problem might be coming from using CoreText framework. I’d like to hear from anyone who ever used this framework heavily and can confirm/deny that any problems exists there.
4) –any other suggestions–

P.S. I didn’t include any code snippets because the code itself is pretty huge and I cannot reduce the amount of suspicious code to a reasonable amount.

  • 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-16T03:44:10+00:00Added an answer on May 16, 2026 at 3:44 am

    A little silly perhaps, but when something roughly similar happened to me, I realized I had NSZombies enabled. Since then, my didFinishLaunching: has the following couple of lines at the top:

    if (getenv("NSZombieEnabled") || getenv("NSAutoreleaseFreedObjectCheckEnabled")) {
        NSLog(@"NSZombieEnabled/NSAutoreleaseFreedObjectCheckEnabled enabled!");
    } else {
        NSLog(@"No NSZombieEnabled or NSAutoreleaseFreedObjectCheckEnabled");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

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.