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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:46:13+00:00 2026-05-23T17:46:13+00:00

Here’s some strange behavior I hope someone can confirm is a known bug, or

  • 0

Here’s some strange behavior I hope someone can confirm is a known bug, or suggest a workaround.

My iPad app needs to display some large PDFs (~7mb and graphics-heavy.) The path of least resistance is of course a UIWebView, but my app crashes after display of a few. I isolated the behavior in a new project, and ran Instruments on it.

Here are the results. They seem to indicate that bad leaks are happening in UIWebView.

The essential code, in a minimal view controller:

-(IBAction)doPresent:(UIView *)sender
{
  NSURL *url = [[NSBundle mainBundle] URLForResource:[NSString stringWithFormat:@"%d", [sender tag]]
                                       withExtension:@"pdf"];
  UIWebView *wv = [[[UIWebView alloc] init] autorelease];
  UIViewController *vc = [[[UIViewController alloc] init] autorelease];
  [vc setView:wv];
  UINavigationController *holder = [[[UINavigationController alloc] initWithRootViewController:vc] autorelease];

  [self presentModalViewController:holder animated:YES];
  [wv loadRequest:[NSURLRequest requestWithURL:url]];

  UIBarButtonItem *close = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone
                                                                          target:self
                                                                          action:@selector(doDismiss:)] autorelease];
  [[vc navigationItem] setRightBarButtonItem:close];
}

-(IBAction)doDismiss:(id)sender
{
  [self dismissModalViewControllerAnimated:YES];
}

Not pictured: the main nib containing this VC, its view, and five buttons connected to doPresent:, each tagged with 1…5; and 1.pdf through 5.pdf in the app bundle. Run it and it works much as you’d expect, except that it crashes after a half-dozen or so views of the PDFs.

Running it under Instruments (allocations) yielded this interesting plot:
plot of memory usage

The pattern I notice is that, if I display a PDF and dismiss it without scrolling around the document, it’s released as expected with minimal leakage. But if I touch it and scroll, even a little, the memory is not released. Viewing subsequent PDFs does not appear to reuse any of the wasted memory but each allocates more of its own. Running in the simulator and triggering memory warnings doesn’t get this memory back either.

When usage hit ~ 25mb, the program got kill -9‘d. This seems low to me, suggesting some other resource is being leaked besides app memory.

This is on a iPad 1, running 4.3, freshly rebooted.

Ideas? Workarounds? Foolish omissions on my part?

  • 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-23T17:46:14+00:00Added an answer on May 23, 2026 at 5:46 pm

    Well, Apple finally got back to me on the bug report, and they recognize the bug and claim it’s fixed in the latest ios 5.x builds. We’ll see.

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

Sidebar

Related Questions

Here are some facts about my app followed by a question My app has
I have a jquery bug and I've been looking for hours now, I can't
Here is my code sample, let me know if it can be further improved?
Here is the exact copy of my code: jsFiddleCode As you can see I
Here is the scenario: I'm writing an app that will watch for any changes
Here's the view: @if (stream.StreamSourceId == 1) { <img class=source src=@Url.Content(~/Public/assets/images/own3dlogo.png) alt= /> }
Here's my code in the <head></head> : <link rel=stylesheet href=http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css /> <script type=text/javascript src=http://code.jquery.com/jquery-1.7.1.min.js></script>
Here is the code in a function I'm trying to revise. This example works
Here is the code: create table `team`.`User`( `UserID` bigint NOT NULL AUTO_INCREMENT , `Username`
Here is my work environment: Eclipse Juno as IDE with maven2 plugin on it

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.