- How to check the storage on your iPhone, iPad, and iPod touch
- How iOS and iPadOS optimize storage
- Use your device to check its storage
- Content categories
- Use recommendations to optimize storage
- Use the Finder or iTunes to check the storage on your iOS device
- About cached files in «Other»
- If storage on your device differs from what you see in the Finder or iTunes
- If you want to delete the cached files from your device
- Learn more
- When Apple talks about «Memory», what do they mean?
- 3 Answers 3
- iPhone OS Memory Warnings. What Do The Different Levels Mean?
- 3 Answers 3
How to check the storage on your iPhone, iPad, and iPod touch
iOS and iPadOS monitor the storage on your device by analyzing how much space each app uses. You can also check the storage on your device in Settings, iTunes, or the Finder on your computer.
How iOS and iPadOS optimize storage
If your device is low on storage, it automatically frees up space while installing an app, updating iOS or iPadOS, downloading music, recording videos, and more.
To make more storage available, your device can remove some of your items, like streamed music and videos, files in iCloud Drive, and parts of apps that aren’t needed. It also removes temporary files and clears the cache on your device. But your device only removes items that can be downloaded again or that aren’t needed anymore.
Use your device to check its storage
Go to Settings > General > [Device] Storage. You might see a list of recommendations for optimizing your device’s storage, followed by a list of installed apps and the amount of storage each one uses. Tap an app’s name for more information about its storage. Cached data and temporary data might not be counted as usage.
In the detailed view you can:
- Offload the app, which frees up storage used by the app, but keeps its documents and data.
- Delete the app, which removes the app and its related data.
- Depending on the app, you might be able to delete some of its documents and data.
If your device is almost full and can’t free up space, you might get a Storage Almost Full alert. If you see this alert, you should check the storage recommendations or you need to offload some less-used content like videos and apps.
Content categories
The used content on your device is divided in these categories:
- Apps: Installed apps and their content, and content stored in «On My iPhone/iPad/iPod touch» directory in the Files app, and Safari downloads
- Photos: Photos and videos stored in the Photos app
- Media: Music, videos, podcasts, ringtones, artwork, and Voice Memos
- Mail: Emails and their attachments
- Apple Books: Books and PDFs in the Books app
- Messages: Messages and their attachments
- iCloud Drive: iCloud Drive content that has been downloaded locally to your device. This content can’t be automatically deleted.
- Other: Non-removable mobile assets, like Siri voices, fonts, dictionaries, non-removable logs and caches, Spotlight index, and system data, such as Keychain and CloudKit Database. Cached files can’t be deleted by the system.
- System: Space taken by the operating system. This can vary based on your device and model.
Use recommendations to optimize storage
In the Storage section of Settings, your device might offer recommendations for optimizing your storage. Tap Show All to see all the recommendations for your device.
Read the description of each recommendation, then tap Enable to turn it on or tap the recommendation to review the contents you can delete.
Use the Finder or iTunes to check the storage on your iOS device
- On a Mac with macOS Catalina 10.15 or later, open the Finder. On a Mac with macOS Mojave 10.14 or earlier, or on a PC, open iTunes.
- Connect your device to your computer.
- Select your device in the Finder or in iTunes. You’ll see a bar that shows how much storage your content uses, divided by content type.
- Move your mouse over the bar to see how much storage each content type is using.
Here’s a list of the types of content on your device, and what each type includes:
- Audio: Songs, audio podcasts, audiobooks, voice memos, and ringtones.
- Video: Movies, music videos, and TV shows.
- Photos: Content in your Photo Library, Camera Roll, and Photo Stream.
- Apps: Installed apps. The content of the apps is listed under Documents & Data.
- Books: iBooks books, audio books, and PDF files.
- Documents & Data: Safari Offline Reading List, files stored within installed apps, and app content like contacts, calendars, messages, and emails (and their attachments).
- Other: Settings, Siri voices, system data, and cached files.
About cached files in «Other»
The Finder and iTunes categorize cached music, videos, and photos as Other instead of actual songs, videos, or photos. Cached files are created when you stream or view content like music, videos, and photos. When you stream music or video, that content is stored as cached files on your device so you can quickly access it again.
Your device automatically removes cached files and temporary files when your device needs more space.
If storage on your device differs from what you see in the Finder or iTunes
Since the Finder and iTunes categorize cached files as Other, reported usage for Music or Videos might differ. To view usage on your device, go to Settings > General > [Device] Storage.
If you want to delete the cached files from your device
Your device automatically deletes cached files and temporary files when it needs more space. You don’t need to delete them yourself.
Learn more
- To reduce the size of your Photo library, turn on iCloud Photo Library and optimize your device storage.
- Optimize your music and videos storage in Settings > Music > Optimize Storage.
- Learn how iOS, iPadOS, and macOS report storage capacity.
Information about products not manufactured by Apple, or independent websites not controlled or tested by Apple, is provided without recommendation or endorsement. Apple assumes no responsibility with regard to the selection, performance, or use of third-party websites or products. Apple makes no representations regarding third-party website accuracy or reliability. Contact the vendor for additional information.
Источник
When Apple talks about «Memory», what do they mean?
For my understanding there are always two types of memory:
the working storage
So when you have a 16 GB iPhone, does it have 16 GB of working storage? or 16 GB of «disk space»? Which «Memory» is Apple talking about in his Docs, when it comes to performance and memory management? It looks like the working storage, but I am not sure. Actually I thought the iPhone is a huge brick of working storage, since all that stuff is just a solid block of chip memory (no hard drive).
3 Answers 3
The iPhone has 16GB (or 8 or 4, depending on the model) of non-volatile flash memory that persists even when the power is turned off. It also has 128MB of volatile DRAM that gets lost when the power is turned off. The relative differences are:
- Flash memory is cheap, DRAM is expensive
- Flash memory is slow, DRAM is fast
- Flash memory is non-volatile, DRAM is volatile
The flash memory is essentially like a hard drive, except it’s a solid-state memory, not a rotating platter of magnetic dipoles.
Generally, in iPhone development, when you’re talking about memory, you’re talking about DRAM. DRAM is a more limited resource and more likely to run out, since it’s very easy for an app do eat up megabytes by poor memory management. It’s a lot harder to run out of flash memory, since doing so would involve writing very large files into the file system.
A simpler way of explaining it:
Every iPhone has 128 MB of RAM. Your application generally can’t use more than
22 MB of it, and it does not use a swapfile for RAM expansion.
The advertised storage capacities (4/8/16 GB) are «disk» space for the filesystem.
The flash memory that makes up most of the iPhone’s advertized «memory» is a kind of hybrid between RAM and «disk space» in its most important characteristics:
- Less expensive than RAM, more expensive than a harddisk
- Sequential transfer rate is lower than RAM’s, about the same as a harddisk’s (though this really depends on the type and quality of flash memory)
- Random access delay is higher than RAM’s, but much lower than a harddisk’s
The last point is the most important one from a programmer’s point of view. All kinds of basic programming techniques and an incredible amount of effort hinges on the fact that compared to most other things that happen in a computer, random access to harddisk memory takes eons because it involves physical movements — and that’s where most of your storage is.
This basically means that in an environment with flash memory instead of a harddisk, you can get away with a lot of shit that would absolutely kill an app operating with a harddisk. There aren’t really any downsides except for the limited amount of storage. Of course, conversely, it may mean that an app ported from the iPhone to a PC may exhibit godawful performance. Then again, the PC’s OS might hide this by caching HD accesses in the more plentiful RAM.
Источник
iPhone OS Memory Warnings. What Do The Different Levels Mean?
Regarding the black art of managing memory on iPhone OS devices: what do the different levels of memory warning mean. Level 1? Level 2? Does the dial go to 11?
Context: After an extensive memory stress testing period — including running my iPad app with the iPod music player app playing, I am inclined to ignore the random yet infrequent memory warnings I am receiving. My app never crashes. Ever. My app is leak free. And, well, the mems warnings just don’t seem to matter.
3 Answers 3
Memory level warnings are logged by SpringBoard. As an app developer you don’t need to care about it. Just responding to —
There are 4 levels of warnings (0 to 3). These are set from the kernel memory watcher, and can be obtained by the not-so-public function OSMemoryNotificationCurrentLevel() .
How the levels are triggered is not documented. SpringBoard is configured to do the following in each memory level:
- Warning (not-normal) — Relaunch, or delay auto relaunch of nonessential background apps e.g. Mail.
- Urgent — Quit all background apps, e.g. Safari and iPod.
- Critical and beyond — The kernel will take over, probably killing SpringBoard or even reboot.
Killing the active app (jetsam) is not handled by SpringBoard, but launchd .
Basically the warnings mean that the device is running low on memory, and that, «If you could please free some memory you aren’t actively using that’d be swell!«. If your memory management is tight, and you have no objects that could practically be discarded, just pass the message along and ignore it.
totoal 5 levels of memory warning (-1,3).
Regarding Memory Level warning description, @KennyTM’s answer is excellent.
I want to add several related points which may help PM and others.
What should you do when having Memory Level Warning?
Upon receiving any of these warnings, your handler method should respond by immediately freeing up any unneeded memory. For example, the default behavior of the UIViewController class is to purge its view if that view is not currently visible; subclasses can supplement the default behavior by purging additional data structures. An app that maintains a cache of images might respond by releasing any images that are not currently onscreen.
How to observe Memory Level warning?
When the system dispatches a low-memory warning to your app, respond immediately. iOS notifies all running apps whenever the amount of free memory dips below a safe threshold. (It does not notify suspended apps.) If your app receives this warning, it must free up as much memory as possible. The best way to do this is to remove strong references to caches, image objects, and other data objects that can be recreated later.
UIKit provides several ways to receive low-memory warnings, including the following:
- Implement the applicationDidReceiveMemoryWarning: method of your app delegate.
- Override the didReceiveMemoryWarning method in your custom UIViewController subclass.
- Register to receive the UIApplicationDidReceiveMemoryWarningNotificationnotification.
How to Reduce Your App’s Memory Footprint?
- Eliminate memory leaks.
- Make resource files as small as possible.
- Use Core Data or SQLite for large data sets.
- Load resources lazily.
- Build your program using the Thumb option.
How to allocate memory wisely?
- Reduce your use of autoreleased objects : With automatic reference counting (ARC), it is better to alloc/init objects and let the compiler release them for you at the appropriate time. This is true even for temporary objects that in the past you might have autoreleased to prevent them from living past the scope of the current method.
- Impose size limits on resources : Avoid loading a large resource file when a smaller one will do. Instead of using a high-resolution image, use one that is appropriately sized for iOS-based devices. If you must use large resource files, find ways to load only the portion of the file that you need at any given time. For example, rather than load the entire file into memory, use the mmap and munmap functions to map portions of the file into and out of memory. For more information about mapping files into memory.
- Avoid unbounded problem sets : Unbounded problem sets might require an arbitrarily large amount of data to compute. If the set requires more memory than is available, your app may be unable to complete the calculations. Your apps should avoid such sets whenever possible and work on problems with known memory limits.
Источник