Question

Description

my app is only using 35-70mb and is sometimes getting killed with 35mb in the report. The reason always being vm-pageshortage

  1. go from any map view to the camera (repeat N times. on devices with a lot of free RAM it takes longer of course)
  2. you will start (quite soon(!) to receive memory warnings
  3. BOOM (killed)

This works in any app that uses either MKMapKit or GoogleMaps. I guess it is related some graphics data that doesnt show up in instruments but is in the VM. This didnt happen in IOS6

GMS Bug Tracker issue with DEMO code

https://code.google.com/p/gmaps-api-issues/issues/detail?id=6209&thanks=6209&ts=1388925382)

question 1

Im releasing the objects just fine on my side and I see dealloc is called correctly. => can I somehow influence MapKit / GoogleMaps to release VM space.

question 2

What's strange is that according to the report there are even bigger apps on the system but ours gets killed: => Is there some mechanic in the whatchdog to prefer to kill DEBUG (or maybe non-appstore) apps before appstore apps?

Sample project: only 1 view controller, only 1 map (via Apple MapKit, GMS is equally bad), push camera and take a pic--- BOOM

runnable code: https://dl.dropboxusercontent.com/u/3753090/MapKitTest.zip

- (void)loadView {
    UIView *v = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

    CGRect f = v.bounds;
    mapView = [[MKMapView alloc] initWithFrame:CGRectInset(f, 5, 5)];
    [v addSubview:mapView];

    self.view = v;
}

- (void)viewDidAppear:(BOOL)animated {
    [self performSelector:@selector(delayed) withObject:nil afterDelay:3];
}

- (void)delayed {
    UIImagePickerController* imagePickerController = [[UIImagePickerController alloc] init];
    imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
    imagePickerController.delegate = (id)self;
    imagePickerController.showsCameraControls = NO;
    [self presentViewController:imagePickerController animated:YES completion:nil];

    [imagePickerController performSelector:@selector(takePicture) withObject:nil afterDelay:2];
}

- (void)imagePickerController:(UIImagePickerController *)imagePicker didFinishPickingMediaWithInfo:(NSDictionary *)info {
    UIImage* image = [info objectForKey:UIImagePickerControllerOriginalImage];
    NSData *jpg = UIImageJPEGRepresentation(image, 0.8);
    NSLog(@"jpg %d", ((const char*)jpg.bytes)[0]);
    [self dismissViewControllerAnimated:YES completion:nil];
}

an instruments screenshot:
https://www.dropbox.com/s/v1v5ll8v5kjt7ev/Screenshot%202014-01-05%2021.00.58.png

and the report:
https://dl.dropboxusercontent.com/u/3753090/report%2005-01-14%2021-00.crash

Was it helpful?

Solution

apple acknowledged the bug and claims to have fixed it with 7.1 -- anyhow they confirmed the issue so there is no mistake on my side.

I guess a 4s is just no device for ios7 anymore :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top