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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T22:14:57+00:00 2026-06-02T22:14:57+00:00

I have problem with memory. I use ARC. I’ m loading .jpgs to UIImageView

  • 0

I have problem with memory. I use ARC. I’ m loading .jpgs to UIImageView on my view.

Code showing example situation:

//.h file

@interface myClass : UIViewController
{
    IBOutlet UIImageView * back;
}
// don' t have @property
// back is connected in .xib

//.m file
-(void) viewDidLoad {
    UIImage *  myImg =[UIImage imageNamed:imgName];

    back.image=myImg;
}

-(void) returnToPrevoriousView {
   [self removeFromSuperview];
   back.image = nil;
}

The problem is that i come to this view from the other view and imgName can have many values. I can come myClass for example six times then I have log: Recieve memory warning and my app crash.

I think myImg isn’ t released from memory? I don’ t have any idea how fix it ? JPGs have about 100kb.

PS. When I load .png it’ s works(aslo faster) in spite of .png images have usually 600kB. But I think it still don’ t release 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-02T22:14:58+00:00Added an answer on June 2, 2026 at 10:14 pm

    Do not use UIImage imageNamed: if you are certain that the image will not be used again within your app. imageNamed: uses an internal caching mechanism that will use additional memory.

    From the UIImage Class Reference:

    This method looks in the system caches for an image object with the
    specified name and returns that object if it exists. If a matching
    image object is not already in the cache, this method loads the image
    data from the specified file, caches it, and then returns the
    resulting object.

    Instead use UIImage imageWithContentsOfFile: for single use images as those are not cached.

    Note: only imageNamed: will do automatic retina version loading (@2x).

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

Sidebar

Related Questions

I have a problem with memory use in my java app and for the
I have problem with increasing memory. I use MEF in caliburn.micro on creation new
I have a problem with 90mb peak memory limit issue. For example: I create
here's a problem with memory management issue. Say i have a view A, it
I have problem with my widget related to performance and memory: Issue : My
I have a problem with out of memory when I'm trying load a few
I have a Problem in my App with the Dirty Memory Size and want
We have a memory overwrite problem. At some point, during the course of our
I have a memory leak from 3 UIImages the problem is I can't just
This is a C# problem. I have a big object in memory at a

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.