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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T05:19:06+00:00 2026-05-30T05:19:06+00:00

I’m developing an app that use a lot of images, I’m using the UIWebView

  • 0

I’m developing an app that use a lot of images, I’m using the UIWebView to represent about 200 image using JavaScript code (i’m using UIZE library), the problem is when i’m done with the UIWebView, i’m using the following code in the viewWillDisappear

-(void)viewWillDisappear:(BOOL)animated {
    [[NSURLCache sharedURLCache] removeAllCachedResponses];
    [webViews stringByEvaluatingJavaScriptFromString:@"document.open();document.close();"];
}

with

- (void)viewDidUnload
{
    webViews = nil;
}
- (void)dealloc {
    [webViews release];
}

But, the reserved memory that taken from the UIWebView is still in memory,so my first question is How to force the app to free up the memory that got taken from the UIWebView?

The same problem goes with UIImageView, i’m using a large image (about 3072*2024) that will take (3072 * 2024 * 3 = 18 MB) from the memory, i’m loading about 8 image like that at once, so the reserved memory is huge, and when i’m trying to release them, the same thing happen, the reserved memory that taken from each image is still in the memory (I’m always get the warning that said Low Memory warning). I’ve managed to load about 2 image of that size to reduce the reserved memory but the memory doesn’t free up the memory until the low memory warning is appear, So, How can i reduce and deal with a huge number image and to free up the reserved memory at instance !?

Note:

I’ve used a hacked version for [UIImage imageNamed:]; method as the following:

@implementation UIImage(imageNamed_Hack)

+ (UIImage *)imageNamed:(NSString *)name {
return [UIImage imageWithContentsOfFile:[NSString stringWithFormat:@"%@/%@", [[NSBundle mainBundle] bundlePath], name ] ];
}
@end

Any help will be appreciated.

Thx in advance.

  • 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-30T05:19:07+00:00Added an answer on May 30, 2026 at 5:19 am

    Try this:

    - (void)viewDidUnload
    {
    [webViews release];
    webViews = nil;
    }
    

    It is really important to release before you set it to nil. Setting a variable to nil doesn’t mean it is freed. You set its pointer to nil, but the memory where it pointed before will remain there and cause a leak. This is the main problem.

    With the images, you can do the following:
    Don’t use a UIImageView in these cases, what I would propose, is to use CATiledLayer and render the images directly on it.
    Here’s the class reference for it: CATiledLayer
    It has two sample applications. I think you should check the PhotoScroller application created by Apple, it can give you an idea how you can solve your problem. The main idea is to render the image in tiles, so only parts of the images will be rendered, that are on the screen currently, this saves a lot of memory, because it will not render off screen parts.

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

Sidebar

Related Questions

I am reading a book about Javascript and jQuery and using one of the
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I am using Paperclip to handle profile photo uploads in my app. They upload
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace

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.