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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:35:35+00:00 2026-06-18T09:35:35+00:00

Apps under iOS receive low memory warnings via these mechanisms: [AppDelegate applicationDidReceiveMemoryWarning:] UIApplicationDidReceiveMemoryWarningNotification [UIViewController

  • 0

Apps under iOS receive low memory warnings via these mechanisms:

  • [AppDelegate applicationDidReceiveMemoryWarning:]

  • UIApplicationDidReceiveMemoryWarningNotification

  • [UIViewController didReceiveMemoryWarning]

What are the relationships between these items? Do they all occur when a low memory condition is received or do they have subtle differences? In what order are they executed?

In the simulator there is an option to “Simulate memory warnings”. Does this do anything except for called didReceiveMemoryWarning: on all UIViewControllers?

I’m wanting to use the Xcode profiler tool to see what happens these days around images loaded by the caching [UIImage imageNamed:] method — are they uncached? — but I need to know how to ‘properly’ trigger low memory conditions — even if it’s just by allocating a whole lot of memory.

  • 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-18T09:35:37+00:00Added an answer on June 18, 2026 at 9:35 am

    In answer to your question about the UIImage cache for imageNamed, yes, it appears that it does purge the cache. Here I loaded 225 images via imageNamed and then, 20 seconds into the execution, I simulated a memory warning:

    allocations for imageNamed

    Having said that, I think the imageNamed cache is a blunt instrument, and I prefer to do my own cache via NSCache, so I can constrain how many images it should retain in the cache by setting countLimit, with the goal of preventing a memory warning at all. As an aside, while NSCache does not respond to UIApplicationDidReceiveMemoryWarningNotification, it does automatically purge itself in real low memory situations. It will not, though, respond to manually simulating memory warning in the simulator.

    Anyway, here is the log of loading images with a NSCache, first without the countLimit and secondly with a countLimit of 50, purging the cache at the end of each:

    NSCache without and with countLimit

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

Sidebar

Related Questions

Under iOS there are several built in hooks for launching service-specific apps based on
I published my first app yesterday evening, and it appears under this url: https://play.google.com/store/apps/details?id=com.appname
I'm developing mobile apps for iOS and Android. Mostly iOS. One of the clients
I'm writing scripts to deploy apps under Tomcat. There are different ways of configuring
I've configured smtp_settings for sending emails under Google Apps accounts several times, but now
In general I know how to do the Localization of iOS apps, the only
I want to be able to host multiple NodeJS apps under the same domain,
I'm trying to run a few Sinatra apps under sub-uri's, but it seems that
I am a newbie and have been developing iOS apps for a about a
We have a site which integrates Java web apps under Tomcat with ASP pages,

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.