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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:43:16+00:00 2026-06-13T21:43:16+00:00

My app runs in Instruments taking up approximately 700 KB of Live Bytes on

  • 0

My app runs in Instruments taking up approximately 700 KB of Live Bytes on average while running. However, every time it loads a new full-screen image, the memory allocations jump about 10 MB for a second, and then recover to the normal 700 KB level.

This is okay at the beginning, but once it has happened a few times I receive memory warnings and the app quits, even though the total Live Bytes stabilises well under the 1 MB mark.

I have created a test project to see why this is happening. It is a Single View Application with only the following code in the View Controller:

- (void)viewDidLoad
{
    [super viewDidLoad];

    NSString *imgFile = [[NSBundle mainBundle] pathForResource:@"00-bg" ofType:@"png"];
    UIImage *img = [[UIImage alloc] initWithContentsOfFile:imgFile];

    UIImageView *backgroundImageView = [[UIImageView alloc] initWithImage:img];
    [img release];

    [self.view addSubview:backgroundImageView];
    [backgroundImageView release];
}

The output from Instruments (Leaks) looks like this:
output from Instruments

I have tried both ARC and non-ARC, and the only difference is the length of the spike (ARC seems to hold onto the memory for longer).

I have also tried both UIImage imageNamed: and initWithContentsOfFile: but the results are the same.

Why is this spike happening? And is there anything I can do to avoid it?

  • 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-13T21:43:17+00:00Added an answer on June 13, 2026 at 9:43 pm

    To display them on screen, iOS has to uncompress your images and that’s where your spike comes from.

    2048 * 1536 = 3145728 pixels. At 4 bytes per pixel that is 12 MB.

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

Sidebar

Related Questions

My app runs fine on my machine (of course/famous last words). However, when deploying
My app runs fine on the simulator. However, when I run it on my
My java / jython app runs a ‘default’ SWT main loop like this: while
My app runs great on the ICS emu. However, using Gingerbread, it crashes whenever
My web app runs fine after I changed the system locale however whenever files
My app runs fine for a while in simulator, although after a few touches,
I have a load of logs being generated each time an app runs, I
The app runs fine using django internal server however when I use apache +
On my android app, first time when app runs, user must type a license.
I have a scroll view app which runs fine on the simulator, however, when

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.