UIImagePickerController Retired Memory

I allow the user to select a video from his / her library. When the photo library opens, it seems that about 1.5Mb has been added to Documents and Data, if I have to look in Settings-> General-> Use. As soon as the user selects the video and compresses, a total of about 4.5 MB is added to Documents and Data. My problem is that this data / memory is never released. All this is added before any salvation is made. Thus, the number of documents and data is increasing, and I'm not sure why. I am sure that everything is freed.

- (void)viewDidAppear:(BOOL)animated { //[super viewDidAppear:animated]; if (IsFirstCall) { UIImagePickerController *uploadPick = [[[UIImagePickerController alloc] init] autorelease] ; uploadPick.delegate = self; uploadPick.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; uploadPick.mediaTypes = [[[NSArray alloc] initWithObjects:(NSString *) kUTTypeMovie, nil] autorelease]; [self presentViewController:uploadPick animated:YES completion:nil]; //[uploadPick release]; } } 

Any help is appreciated. I do not think that it is possible to use the file manager tool on a real phone, it seems that it works only for the simulator. I spent a lot of time trying to understand why this is happening.

+4
source share
1 answer

The possibility of what happens here is actually temporary files that are saved. You say that video compression seems to cause this increase in space.

There are two ways to confirm this in one of two ways. Reboot the device you are testing on. Temporary elements will be cleared by the system either if additional space is needed, or when the system is turned off.

Another method (and probably more informative) is to explore the Application through the Xcode organizer. You can do this by selecting the application on the device and viewing the application directory structure. Each application receives 3 directories, / Documents, / Library and / tmp.

For intensive operations that may require large amounts of memory, some libraries will save completed data to disk to free up memory. As soon as the operation is completed, it will give you a data block, which will either refer to the data in the temporary file, or the completed data will be loaded back into the memory. This process is completely transparent to the user and the developer and uses a large amount of flash memory, and does not fully rely on relatively limited RAM.

If this is not a temporary file, but something that is in the Documents folder of the application (or even the library), it would be useful to download it to your computer and try to investigate its contents, as this may give you some hints regarding of what is happening.

Hope this helps

Edited point for clarity

+1
source

All Articles