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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T16:48:14+00:00 2026-06-10T16:48:14+00:00

In the Apple documentation , it says: The AppKit and UIKit frameworks process each

  • 0

In the Apple documentation, it says:

The AppKit and UIKit frameworks process each event-loop iteration
(such as a mouse down event or a tap) within an autorelease pool
block. Therefore you typically do not have to create an autorelease
pool block yourself, or even see the code that is used to create one.

Now, this should be obvious, but I’ll ask for confirmation anyway.

If I’m developing for what would eventually be a background process (via Grand Central Dispatch), but for simplicity I first just put it in viewDidLoad of the very first loading view so that my view actually won’t be shown on the screen until all that (say) 2 minutes of processing is done, then during this two minutes all that default autorelease pool is never freed because it has not gone through the event loop-iteration yet, right? It would be just plain insane to hear a no, but I’m stuck in this growing memory problem, so I’m going to ask for a confirmation and hope for a good news.

If so, I should put my own autorelease block(s). I would still need the autorelease blocks if the processing is done in a background process via GCD, right?

  • 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-10T16:48:15+00:00Added an answer on June 10, 2026 at 4:48 pm

    I’ll try to give you a complete answer of both your questions.

    Part one. First pay attention to long running operations in the main threads. If for example your operation takes two minutes, the main thread will be blocked until it has completed. From the user point of view, the app will not be responsive for two minutes.
    Anyway, yes in the application delegate there is a pool where autoreleased objects are inserted. When the loop ends, the objects inside the pool are released since the pool is drained automatically.
    If you have memory problem you could take a look at Use Local Autorelease Pool Blocks to Reduce Peak Memory Footprint. As written in doc you should wrap an operation in a autorelease block. At the end of the block, the temporary objects are released, which typically results in their deallocation thereby reducing the program’s memory footprint.

    About the GCD question I would say no. You don’t have to create an autorelease pool when you deal with GCD. Usually, as also written in Do you need to create an NSAutoreleasePool within a block in GCD?, GCD manages an autorelease pool per queue automatically. So, if you have few objects you don’t have to worry about it but if you create a lot of them, yes, create an autorelease pool. The latter allows you to reduce memory footprint as well.

    So for this entire two minutes where the app will not be responsive,
    it is when the loop has not ended, and the pool is not drained during
    these two minutes, right?

    The app is not responsive since the main thread (through the run loop) executes tasks in a sequential order. If you block the run loop the app freezes until the long running operation is finished (I think the app is killed by iOS if you exceed a specific period of time). To avoid this, you could perform (as you wrote) the long running operation in a different thread.

    The goal of using thread is to make the application highly responsive but it could lead to various problem like inconsistent data (race condition) or deadlocks.

    For further info I really suggest to read The pogo stick of NSRunLoop, Understanding NSRunLoop and NSDefaultRunLoopMode vs NSRunLoopCommonModes.

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

Sidebar

Related Questions

The Apple developer documentation says mouseout event is supported on IOS; http://developer.apple.com/library/iOS/#documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html But I
The Apple documentation says that the sender passed to the NSMenuItem's action can be
In the Apple documentation, it says... iPhone OS looks for a Default.png file, located
As Apple documentation says expectedContentLength of NSURLResponse may not return the value, if the
The apple documentation for UIAcceleration class says, When a device is laying still with
Apple's documentation recommends installing a keep-alive handler in the applicationDidEnterBackground: method. It also says
My UIDatePicker is set to UIDatePickerModeTime but on the apple documentation it says The
The Apple documentation says that the - (void)removeObject:(id)anObject method removes all occurrences of the
Is there a traffic limit on Apple's PNS? Documentation says: You should also retain
Apple documentation says that scrollViewWillScrollToTop: will be called as part of the UIScrollViewDelegate protoco.

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.