But specs don’t always — or even most of the time — tell the whole story. As it turns out, an iPhone 6 with 1GB of RAM runs much faster than a similarly speed Android smartphone with 2GB of RAM. And it all has to do with the fundamental difference in the way iOS and Android handle apps.
According to Glyn Williams over on Quora, iOS devices run better than Android devices with twice the RAM because
Android apps use Java, and need all the extra RAM to do something called garbage collection.
What’s garbage collection?
It’s a process that triggers the recycling of memory once an Android app is done using it. Usually, this works pretty well on systems that have a lot of free RAM, but once you get a lot of different apps running, things start getting dicey.
According to Williams, Android’s garbage collectors work best when Android apps have 4 to 8 times as much memory as is actually needed in order to perform the garbage collection process. Once you stop having that amount of free memory available, performance starts suffering.
As for iOS, The operating system doesn’t need all the extra memory associated with Java and Android, since it was designed to avoid this sort of garbage collection from scratch. It only needs the memory it’s using. Amazing isn’t it ?