Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Gherkin

macrumors 6502a
Original poster
Apr 9, 2004
674
305
Memory Swap probably didn’t mean much to most iPad users if they watched the keynote for iPadOS 16 back in June, but anyone who has tried to use their iPad as a full time computer knows it could be a game changer.

Now that 16 is out, has there been any testing done on how this helps? I actually forgot about this feature so I haven’t really been paying attention, but I’ll try to see throughout the day today if apps seem to stay in memory longer. Even on my M1 iPad Pro (8 GB) I’ve noticed apps get dumped an unusually high amount of time.
 

Aston441

macrumors 68030
Sep 16, 2014
2,606
3,934
Wait? There's a swap file now? Granted it's early 1950s technology, but I didn't think Apple had advanced that far!?!

If it keeps tabs from reloading I'll be amazed... trying to decide whether to "upgrade" to ipadOS 16... sigh
 

Propine

macrumors regular
Jun 14, 2020
108
78
Honestly, I haven’t noticed any difference so far. Apps reload from time to time as they did
 

Gherkin

macrumors 6502a
Original poster
Apr 9, 2004
674
305
Honestly, I haven’t noticed any difference so far. Apps reload from time to time as they did

I wonder if apps need to be specifically written to take advantage? or if it's not even really for "every day" apps but only apps like Lightroom, Photoshop, DaVinci, etc would use it?
 
  • Like
Reactions: Propine and souko

BigMcGuire

Cancelled
Jan 10, 2012
9,832
14,025
I cannot speak for iPad OS. But back in the day when Android let you use swap space on removable memory cards in the phone - you could force SOME of the app’s cache management to the card - some apps would error out but most were cool with it. Some apps were programmed to utilize it (but very few did).

My GUESS is that yes, they’d have to be reprogrammed for the most part. But it is an assumption for my part.
 

SRLMJ23

macrumors 68020
Jul 11, 2008
2,307
1,413
Central New York
I read somewhere (trying to find the source article) that the memory swap will only kick in when the iPad Pro is under a very heavy load.

So just having Safari open with some tabs, and you go to another app, I do not think that counts as a heavy load....so tabs may very well refresh. So far, my M2 iPad Pro has been really good at not needing to refresh tabs in Safari when I open other apps.

I will try and find that damn source article, sorry guys & gals.

:apple:
 

Populus

macrumors 601
Aug 24, 2012
4,635
6,705
Spain, Europe
I’m trying to figure it out as well, because depending on how heavy the swap is, I’d rather get a 256GB iPad Pro instead of the 128GB one I have acquired.

I hope we will find out soon.
 

SRLMJ23

macrumors 68020
Jul 11, 2008
2,307
1,413
Central New York

Per Apple:​

Virtual memory swap​

iPad storage can be used to expand the available memory for all apps and delivers up to 16 gigabytes of memory for the most demanding apps.22

22:Available on iPad Air (5th generation) with a minimum of 256GB storage, iPad Pro 12.9-inch (5th generation and later), and iPad Pro 11-inch (3rd generation and later).

Any model with 128GB or more of storage gets the memory swap, hence why the 64GB iPad Air 5th Gen. does not get it.

I have the new M2 iPad Pro 128GB, and I am sticking with it since we get the memory swap feature. Hope that helps a little? From some other things I have read, it seems it mostly meant for running Stage Manager.


:apple:
 
  • Like
Reactions: BigMcGuire

Torty

macrumors 6502a
Oct 16, 2013
934
718

  1. Available on iPad Air (5th generation) with a minimum of 256GB storage, iPad Pro 12.9-inch (5th generation and later), and iPad Pro 11-inch (3rd generation and later).“
So it’s possible with 64GB A12X but not with 256GB A12 IPad air3 😁
 

rui no onna

Contributor
Oct 25, 2013
14,417
12,424

  1. Available on iPad Air (5th generation) with a minimum of 256GB storage, iPad Pro 12.9-inch (5th generation and later), and iPad Pro 11-inch (3rd generation and later).“
So it’s possible with 64GB A12X but not with 256GB A12 IPad air3 😁

Those are all M1 iPads. The 2018 iPP 11” is considered 1st gen since before that was the iPP 9.7” and iPP 10.5”.
 

AnotherScott

macrumors member
Jun 18, 2006
35
4
I haven't installed iOS 16 yet. I'm wondering, can Virtual Memory Swap be turned off? (And if so, can you still run Stage Manager if you don't have Virtual Memory Swap enabled?)
 

AnotherScott

macrumors member
Jun 18, 2006
35
4
Believe it is only for M1 based models?
Yes, the Virtual Memory Swap feature is only available on M1/M2 models that have at least 128 GB storage.

True, according to this post it’s specific to an app and it’s implementation https://developer.apple.com/documen...apple_developer_kernel_increased-memory-limit

Why is this app specific?
Whether it's app-specific is an interesting question.

Quoting again from the Apple feature description page, they say, "iPad storage can be used to expand the available memory for all apps and delivers up to 16 gigabytes of memory for the most demanding apps."

"Can be used...for all apps" could be interpreted either as it will be used for all apps with the "can" referring simply to "if and when a situation calls for it," OR the "can" could be referring to something available for a developer to enable. I'm inclined to think the first, but it is ambiguous.

"delivers up to 16 gigabytes of memory for the most demanding apps" could be interpreted as being the max for all apps combined, or as the max the OS can provide to any single app, or that there's a standard "default" less generous configuration but a developer could flag their demanding app in such a way that the OS could try to give it more, up to that max of 16 (which, btw, I believe is still below what is available in MacOS). It's vague phrasing. But there does seem to be some other relevant info referenced at that linked page, or more specifically, on the link further down on that page to the topic of "Extended Virtual Addressing Entitlement"
 
Last edited:

Ponylover52

Cancelled
Jun 12, 2022
108
104
Maybe it is placebo but as someone who lives in Safari the tabs seem far more stable and I have yet to see any odd reload even having other apps going, in the past even with 8gb safari seemed very eager to dump a tabs memory where now feels far more akin to Mac where for all intent and purposes a tab will not just reload unless you are maxing out memory pressure.
 

name99

macrumors 68020
Jun 21, 2004
2,188
1,997
Wait? There's a swap file now? Granted it's early 1950s technology, but I didn't think Apple had advanced that far!?!

If it keeps tabs from reloading I'll be amazed... trying to decide whether to "upgrade" to ipadOS 16... sigh
There has always been some version of this.
Even the first iPhones implemented PAGING in the senses that
- code was paged in on-demand
- memory-mapped files could be used.

Somewhere along the way (around 2015) the "freezer file" concept was added. This is somewhat like normal swapping/paging out, but done at the per-process level rather than system-wide. I think the idea was that they wanted finer-grained control than traditional system-wide swapping where every app fights with every other app and the OS.
This was added as part of introducing SplitScreen and SlideOver on iPadOS, which I guess frequently pushed memory requirements beyond what was available.

So this is not really new, it's more an expansion of the freezer file concept to allow individual apps access to more "memory" (faked on the SSD) than is installed on the device. As opposed to the previous scheme which allowed a GROUP of processes to collectively use more memory than installed on the device.

But of course it's nice to have for the apps that can use it! Wolfram Player, for example, was very dodgy on the iPad, I expect because it was constantly hitting the maximum memory limit, so it's an example of an app that could benefit substantially from this.
 

rui no onna

Contributor
Oct 25, 2013
14,417
12,424
Maybe it is placebo but as someone who lives in Safari the tabs seem far more stable and I have yet to see any odd reload even having other apps going, in the past even with 8gb safari seemed very eager to dump a tabs memory where now feels far more akin to Mac where for all intent and purposes a tab will not just reload unless you are maxing out memory pressure.

That's interesting. Can't say I've noticed a difference on my M1 iPad. Granted I have the 16GB RAM/1TB SSD version.
 

AnotherScott

macrumors member
Jun 18, 2006
35
4
Wait? There's a swap file now? Granted it's early 1950s technology, but I didn't think Apple had advanced that far!?!

There has always been some version of this.
Even the first iPhones implemented PAGING

My understanding is that, even though it was based on OS X (which has always used a swap file), iOS's version of virtual memory didn't use a swap file because, well, it didn't swap stuff in and out. When stuff was removed from memory, it was just dumped, rather than being stored elsewhere to be swapped back in. So if you needed it again, it would have to be re-loaded from scratch.

As for why Apple didn't implement an OS X type of VM swapfile in iOS in the first place, my guess is that it simply makes a lot more demands on the processor. The early processors were slower to begin with, but also, unlike on a Mac, for a tiny fan-less iPhone or iPad, figuring out how to do things with fewest demands on the processor was probably a priority, to minimize heat generation and also maximize battery life. So maybe it simply took the new Apple silicon to be able to do "proper" VM without generating too much heat for the enclosure, or having too much of an impact on power drain.

(ETA: One more variable is that swapfiles can involve a LOT of writing to storage, and some flash is not conducive to huge amounts of re-writing. I don't know what kind of storage flash Apple used in earlier iPhones/iPads, and whether that's different than what they're using now.)

There is also a potential trade-off... once you start swapping stuff in and out, there is some performance hit, compared to keeping everything in RAM. So at least theoretically, I think, the addition of the swapfile means we should see fewer instance of apps simply crashing (quitting) from running out of memory... but they may get slower (or occasionally less responsive) instead.
 
Last edited:

Ponylover52

Cancelled
Jun 12, 2022
108
104
My understanding is that, even though it was based on OS X (which has always used a swap file), iOS's version of virtual memory didn't use a swap file because, well, it didn't swap stuff in and out. When stuff was removed from memory, it was just dumped, rather than being stored elsewhere to be swapped back in. So if you needed it again, it would have to be re-loaded from scratch.

As for why Apple didn't implement an OS X type of VM swapfile in iOS in the first place, my guess is that it simply makes a lot more demands on the processor. The early processors were slower to begin with, but also, unlike on a Mac, for a tiny fan-less iPhone or iPad, figuring out how to do things with fewest demands on the processor was probably a priority, to minimize heat generation and also maximize battery life. So maybe it simply took the new Apple silicon to be able to do "proper" VM without generating too much heat for the enclosure, or having too much of an impact on power drain.

There is also a potential trade-off... once you start swapping stuff in and out, there is some performance hit, compared to keeping everything in RAM. So at least theoretically, I think, the addition of the swapfile means we should see fewer instance of apps simply crashing (quitting) from running out of memory... but they may get slower (or occasionally less responsive) instead.
Idk macs swap stuff and I’d argue users don’t notice it even in memory if showing swap in use. I think iPad OS should go farther even, I still see apps reloading after some time the AppStore for example where on macs apps are practically static even on 8gb models with a lot of apps open. Is the swapping an app specific thing devs have to enable or is it systemwide from iOS ?
 

name99

macrumors 68020
Jun 21, 2004
2,188
1,997
Idk macs swap stuff and I’d argue users don’t notice it even in memory if showing swap in use. I think iPad OS should go farther even, I still see apps reloading after some time the AppStore for example where on macs apps are practically static even on 8gb models with a lot of apps open. Is the swapping an app specific thing devs have to enable or is it systemwide from iOS ?

A lot of different things are being confused in this thread!

- Paging in a read-only form (eg for the code and RO segments of applications) has been present on iOS since day one. Freezer file (as I described) and large virtual address entitlement (as started this thread) refer to paging OUT, ie writing changed pages to storage; this is not necessary, only paging IN (ie reading from storage) is required for handling code and RO segments of applications.

- Macs have always had paging in both these forms. BUT Macs also early on got compressed memory (first for pixmaps, ie for window backing store, then for generic memory). iOS has also had compressed memory since the beginning. Your Mac will engage in a whole lot of compression before it starts paging out, so that unless you bought a really inappropriate machine for your needs, you should rarely ever see paging out. For example on my mac looking right now I see that I have 7.5GB of compressed memory, but have essentially paged nothing out since this machine was booted about a week ago.

- Especially on iOS/iPadOS/tvOS many apps have adopted the lazy and user hostile coding style of simply quitting the app and restarting if they have been in the background for more than some amount of time. Prominent examples include IMDB and the Prime Video app.
Personally I'd love it if Apple banned apps that did this. It's not at all required by iOS (for example Apple's apps do not do this as a policy choice); it's purely lazy programmers who think it's easier to figure out what has happened while they were sleep by just restarting everything rather than tracking changes.
 

Ponylover52

Cancelled
Jun 12, 2022
108
104
A lot of different things are being confused in this thread!

- Paging in a read-only form (eg for the code and RO segments of applications) has been present on iOS since day one. Freezer file (as I described) and large virtual address entitlement (as started this thread) refer to paging OUT, ie writing changed pages to storage; this is not necessary, only paging IN (ie reading from storage) is required for handling code and RO segments of applications.

- Macs have always had paging in both these forms. BUT Macs also early on got compressed memory (first for pixmaps, ie for window backing store, then for generic memory). iOS has also had compressed memory since the beginning. Your Mac will engage in a whole lot of compression before it starts paging out, so that unless you bought a really inappropriate machine for your needs, you should rarely ever see paging out. For example on my mac looking right now I see that I have 7.5GB of compressed memory, but have essentially paged nothing out since this machine was booted about a week ago.

- Especially on iOS/iPadOS/tvOS many apps have adopted the lazy and user hostile coding style of simply quitting the app and restarting if they have been in the background for more than some amount of time. Prominent examples include IMDB and the Prime Video app.
Personally I'd love it if Apple banned apps that did this. It's not at all required by iOS (for example Apple's apps do not do this as a policy choice); it's purely lazy programmers who think it's easier to figure out what has happened while they were sleep by just restarting everything rather than tracking changes.
That is what I figured and absolutely agree apps need to quit that behavior atleast on iPad apps. Or know when it is a M1/M2 iPad and not just quit on a timer of being inactive.
 

AnotherScott

macrumors member
Jun 18, 2006
35
4
Idk macs swap stuff and I’d argue users don’t notice it even in memory if showing swap in use.
The fact that Mac apps almost never crash/quit no matter how much stuff you load, and the ability to switch between apps almost instantaneously with each app always presenting just as you last left it is all due to its ability to swap. You're not supposed to notice it, so your comment just means it's doing its job.

I think iPad OS should go farther even, I still see apps reloading after some time the AppStore for example where on macs apps are practically static even on 8gb models with a lot of apps open.
That's supposed to be what Apple has brought to the M1/M2 iPads with the new OS (as long as they have at least 128 mb storage). But I don't have one of those iPads, so I don't have any first-hand experience as to how well it works. But the implementation is still limited compared to what can be done on a Mac. It's a little ambiguous, but iOS has a 16 GB limit on VM (I'm not sure if that's per app, or total), whereas on Mac, the swapfile is permitted to continue to grow as long as there is more disk space available.

Is the swapping an app specific thing devs have to enable or is it systemwide from iOS ?
I'm curious about that as well.
 
  • Like
Reactions: Ponylover52
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.