I'm not talking about binary size. I'm talking about the amount of data that can be written to disk during execution inside of certain directories such as Cache or Documents.
I can't find an easy answer in the XCode documentation, which is to say I can find none at all.
I know there is a limit for the cache directory in the form of "oh hey, your device is crashing now", but I haven't determined the actual number, and I am not sure if the Documents folders or other folders have the same restrictions.
Links and numbers are appreciated!
There is no reference or limitation of disk space once the application has been installed to the iPhone, iPad, or iPod Touch device.
The only limitation would be available disk space (whole disk space available) at time of writing to those directories.
Related
I'm wondering how many images I can store in the iPhone documents directory so that I don't get any memory issues. I'm torn between caching images or loading them from a webserver every time the user wants to access them. There most likely won't be more than 10-20 images cached at any given time...
Any thoughts?
There's a 2GB cap on the largest size of a single file in the /Documents folder. Other than that, you can store as many images as you want. iOS itself didn't put a limitation on how much space you can use on a device. So your space limit is the size of Flash on the device (i.e. 16GB, 32GB etc).
You might consider use the /Library/Caches instead because iCloud will attempt to sync the Documents folder (if entitlements are configured). I heard App being rejected by review for excessive use of the Documents folder. To get the path, call NSSearchPathForDirectoriesInDomains with NSCachesDirectory and NSUserDomainMask.
Though a user can determine the size of space you are occupying in System Settings.
You can probably cache as many files as available memory allows, but you absolutely should be safe having 10 - 20 images cached at any given time.
B.T.W., instead of using the documents directory, why not consider using the cache directory as He (+1 to him!) suggests?
Here is a related question that shows how to get the size of the directory.
I need to store images and videos in document directory,So i want to know that maximum how much data i can store in document directory that it will not give me memory warning.
Can anyone tell me maximum data storage possible for document directory in Iphone?
I think there is no limit to the size of your sandbox other than the
remaining capacity of the device itself.
According to apple..
To manage program memory, iPhone OS uses essentially the same virtual
memory system found in Mac OS X. In iPhone OS, each program still has
its own virtual address space, but (unlike Mac OS X) its usable
virtual memory is constrained by the amount of physical memory
available. This is because iPhone OS does not write volatile pages to
disk when memory gets full. Instead, the virtual memory system frees
up volatile memory, as needed, to make sure the running application
has the space it needs. It does this by removing memory pages that are
not being used and that contain read-only contents, such as code
pages. Such pages can always be loaded back into memory later if they
are needed again.
If memory continues to be constrained, the system may also send
notifications to the running applications, asking them to free up
additional memory. All applications should respond to this
notification and do their part to help relieve the memory pressure.
For information on how to handle such notifications in your
application, see “Observing Low-Memory Warnings.”
so there is no size limit as such...
The links bellow may be of some help:
http://www.iphonedevsdk.com/forum/iphone-sdk-development/4083-limit-restrictions-filesize-filecount-app-folder.html
https://discussions.apple.com/message/7599983?messageID=7599983#7599983?messageID=7599983
As of iOS 5.0 Apple began to purge or clean the Caches directory inside individual applications when it decided the device was using too much space. Can anyone point me to the location of documentation or anecdotal information regarding at which threshold this cache cleaning occurs (for instance 90%+ disk usage) and how often it is checked?
From my my testing, it seems that the wipe happens to all not currently running applications when the space usage on the device EXCEEDS the reported amount of space available (seems iPhone lies about space available to prevent you from getting into reserved space). When you cross that line, a dialogue pops up:
And when you hit done, it then wipes the space. This is the only situation that I was able to reliably reproduce to trigger the wipe (for testing / etc), and I did so by filling my device as much as I could with movies and music, and then downloading big files in DropBox.
as far as i know there hasn't been any official information about when the purge happens and - to be honest - you shouldn't be trying to predict it. it IS a problem, though. thankfully, apple has realised this and as of iOS 5.0.1 you can set a "do not backup" flag:
http://developer.apple.com/library/ios/#qa/qa1719/_index.html
so you'll want to place those files in your app's Documents/ dir or your apps Library/Private Documents/ and set the "do not backup" attribute.
I have an app which is quite huge. It has tons of images and sounds. In total it's 30 MB in size.
1) Is there an official limit for the app size?
2) Are there other "practical" limits I should consider?
Reading around, there are reports that the absolute maximum size for an application is 2GB (http://discussions.apple.com/thread.jspa?threadID=1605342).
Other than that, if your app is over 10MB, users will only be able to download it over a wifi connection, having the impact that users won't be able to download your application easily when they are out and about.
This might sound obvious, but there are two size limits to keep in mind here - neither are absolutely defined.
One is the limit for the application bundle. I don't know if there is a real limit (other than the device's flash storage limit), but this should rarely be an issue. Keep in mind the 10Mb threshold that the other Phil mentions though. There may be something in the 2GB limit too, I don't know.
The more important limit is on the size of the loaded binary image and it's runtime memory usage. The iPhone is obviously a constrained device in this area. The original iPhones and iPod touches had 128Mb of total RAM, with no paging. Current models have 256Mb, but it's a bit early to limit yourself to that subset of the installed base if you can help it.
Assuming 128Mb, of that a fair chunk is used by the system itself and its background tasks (and people want user background tasks too!?!).
In a conversation with an Apple Engineer he said that apps should be written to use no more than about 25-30Mb! Up to 60Mb may be available but cannot be counted on (but you could use this extra for caching stuff that you can purge as necessary).
1) I believe that you shouldn't ask for maximum size, as you have to aim for minimum possible size for your apps. As iPhone has limited memory (both storage & RAM), you should not create a huge app. (I doubt an app > 200MB can pass through Apple's app check.)
Yeah, Phil is right, when you app is over 10MB, it can only be downloaded via wifi or iTunes. Quite a lot users may want to download anywhere they like using 3G networks, so >10MB is not recommended.
Also, take care those users with iPhone 2G. If you produce a >10MB app, it takes them a day to download your app (if they are lucky enough to have no disconnection at the middle of download...)
2) practical limit ... K.I.S.S = Keep It Simple and Small.
That's it. Hope it helps.
The reason I ask is my app lets users cache map tiles. Does anyone know the real cap on how much data I can let them store?
You can store as much as you want until you run out flash. Having said that, your users probably won't like it if you start eating all of the space on the phone.
Also, make sure you put it in the Cache folder, as opposed to Documents. The Documents folder gets backed up when you sync to iTunes, the Cache folder is not. If you have a ton of data in the Documents folder it will massively slow down iTunes synching.
About a year ago the word was there is a 2Gb limit on app size, but you'll be hard pressed to find an "official" declaration of such, even on apple's site or the discussion forums there
That being said 2Gb is pretty hearty for a mobile app, caching and all
I'm not aware of any quota for apps using the writable area, but it would be easy enough to check.