4 ms·
Without starting a flame war, can we have a proper discussion on Android and iOS memory management? It seems like iOS and macOS do more with less ram. Why is t
by LASR 3y ago
Without starting a flame war, can we have a proper discussion on Android and iOS memory management?
It seems like iOS and macOS do more with less ram. Why is that?
My outdated view on this is that iOS apps are native vs Android that runs JVM apps. Is that even true still?
- palata 3y agoAndroid doesn't run the JVM, but rather the ART (Android Runtime). It does AOT (ahead-of-time) optimization, which apparently helps a lot. Still I can imagine that it uses slightly more memory...
- Saris 3y agoAndroid also runs multiple apps at once, IIRC iOS only runs the app in the foreground.
- deleted 3y ago[deleted]
- LoganDark 3y ago> It seems like iOS and macOS do more with less ram. Why is that? AFAIK, Android caches things in terms of the JVM/ART using Zygote, but macOS and iOS are designed to run native code, so they cache the actual dynamic libraries themselves (it's called the "dyld shared cache"). Things like libc, some core frameworks and so on go in there. Keep in mind this happens across the entire OS, since the Android user experience is implemented largely in terms of high level JVM/ART objects with all of their associated heap overhead, but iOS and macOS and their apps are mainly implemented in C/C++, Swift, Objective-C, which at most use reference counting, and only for objects that need to be reference counted. This is absolutely not the cause of all memory issues but this is sort of the base level foundational stuff of both platforms and has implications for the higher levels. Even though Android is based on Linux and iOS/macOS are based on Unix and BSD, and those two/three platforms are quite similar conceptually, they have very different userlands.
- iudqnolq 3y agoI get why refcounting could in theory sometimes have less latency than a highly tuned gc. But I don't see how it could possibly be lower memory. Can you explain?
- deleted 3y ago[deleted]