Android vs iOS RAM management - Who does it better?

Поділитися
Вставка
  • Опубліковано 9 чер 2024
  • Following my videos on how much RAM you need for Android, and in an iPhone, here is the third part: Android vs iOS RAM management - Who does it better? Do iPhones need less RAM? Is iOS better optimized? Let's find out.
    How much RAM do you really need in an iPhone? (2022 Edition) - • How much RAM do you re...
    How much RAM does your phone REALLY need in 2022? - • How much RAM does your...
    Let Me Explain T-shirt: teespring.com/gary-explains-l...
    Twitter: / garyexplains
    Instagram: / garyexplains
    #garyexplains

КОМЕНТАРІ • 485

  • @paulbarnett227
    @paulbarnett227 2 роки тому +324

    This sheds a lot of light on why Android needs more RAM than iOS. Excellent insight Gary.

    • @sireajeel5009
      @sireajeel5009 2 роки тому +13

      yea people will still just assume "optimization"

    • @android199ios25
      @android199ios25 2 роки тому +11

      @@sireajeel5009 Sure call it whatever you like, but what are the advantages of the android way vs ios? What is the purpose of writing an app in java only to use android APIs which means it can only run on an android device. Wouldn’t it be better to write native apps for android on ARM which nearly all use?

    • @AestheticBlack1
      @AestheticBlack1 2 роки тому +3

      Yeah cuz IOS can handle better on ram management.

    • @sireajeel5009
      @sireajeel5009 2 роки тому +26

      @@AestheticBlack1 you literally missed the point of Gary's ram explanations.

    • @teemuvesala9575
      @teemuvesala9575 2 роки тому +9

      @@sireajeel5009 Well it quite literally is optimization. On iOS apps run natively while on Android they run through compatibility layer. You can never optimize the apps to run as efficiently on Android devices as you can on iOS devices since it's basically like comparing to running a program in emulation vs natively. Native will always be more efficient. And its for this reason I switched to iPhone.

  • @PerpetualPreponderer
    @PerpetualPreponderer 2 роки тому +2

    Great trilogy Gary, really informative & plenty helpful. Thanks & keep em coming!

  • @anb4351
    @anb4351 2 роки тому +79

    As an android developer, I am confused. Does it mean that writing Android apps in Flutter or Xamarin, which as per my understanding, compiles to native code, is more efficient as compared to writing it in native Kotlin / Java? Can someone please shed some light on it

    • @GaryExplains
      @GaryExplains  2 роки тому +74

      Depends how you define "efficient". Power? CPU? Memory? But yes, Flutter apps would be smaller and likely faster. Not so sure about Xamarin because C# also uses an intermediate language like Java.

    • @JoshuaPack
      @JoshuaPack 2 роки тому +19

      Flutter gets very close to native on Android. if writing native vs flutter, you will see file size higher on flutter due to some overhead, but, I am unsure of RAM management. I bet it's very close to native.

    • @rishirajsaikia1323
      @rishirajsaikia1323 2 роки тому +1

      @@JoshuaPack if flutter and Java are not native for Android, what is ?

    • @JoshuaPack
      @JoshuaPack 2 роки тому +6

      @@rishirajsaikia1323 the Android Native Development Kit is a toolset that is provided by Android to use C or C++ code in your Android application.
      So, I would think C and C++ would be native code.

    • @cronchcrunch
      @cronchcrunch 2 роки тому +4

      Android has used ahead of time compilation for MANY years now, so it compiles down to native machine code during the install process.
      So using the native way would be the fastest. (Android SDK for Kotlin/Java and the NDK for C/C++.
      You can read through the documentation on the Android developer documentation site. I don't want to post a link, since those get deleted quite often, but I'm sure that as a fellow Android dev you know where to find it.

  • @anmolagrawal5358
    @anmolagrawal5358 2 роки тому +1

    Great content coverage as always! This was a comparison that I really wanted to see

  • @chathuravimanga
    @chathuravimanga 2 роки тому +2

    This is so informative and interesting. Thank you Mr.Garry for this.

  • @_Digitalguy
    @_Digitalguy 2 роки тому +70

    Gary I remember you saying in a video a couple of years ago that IOS compressed apps more into RAM than Android (compressed apps were smaller). Do I remember correctly? Is this still true and therefore does this contribute to IOS needing less RAM for similar results?

    • @rafaml
      @rafaml 2 роки тому +3

      I also remember that!

    • @xeon2k8
      @xeon2k8 2 роки тому

      watch the video he released about ios compression couple days ago

    • @rafaml
      @rafaml 2 роки тому +2

      @@xeon2k8 I don't remember watching him compare the amount of space taken by the compressed apps in each OS in that video. I might be wrong tho

    • @_Digitalguy
      @_Digitalguy 2 роки тому +6

      @@xeon2k8 he didn't answer this specific question in that video, he just showed some charts, it's not clear if IOS compresses more

    • @xeon2k8
      @xeon2k8 2 роки тому +1

      @@_Digitalguy that's within "ram management" he's talking so much about. So the answer is NO, it's the same.

  • @warrenmcclure7819
    @warrenmcclure7819 2 роки тому

    I just want to say thank you for these videos. They are very informative and enjoyable to watch.

  • @akza0729
    @akza0729 2 роки тому +11

    This was very informative. I knew it was because of Java's runtime but didn't think the difference would be this much.

  • @lifenator975
    @lifenator975 2 роки тому

    That was a beautiful explanation. Thank you guru !

  • @taidee
    @taidee 2 роки тому

    Great work for the explainer Gary, thank you.

  • @reeii9184
    @reeii9184 2 роки тому +41

    Wouldn't the AOT compilation (which happens at install time) in current android versions mean that android phones execute native code without a virtual machine overhead too, thus reducing the memory footprint? I think I'm missing something here...

    • @GaryExplains
      @GaryExplains  2 роки тому +42

      The problem is the overall model of Java (things like garbage collection) mean it uses more memory even when you use AOT. AOT helps with performance, but not so much with the way Java is designed and how it is designed to use the run time environment.

    • @sprockkets
      @sprockkets 2 роки тому +3

      Current versions of android use both, so it doesn't really matter. They'll do some AOT but use JIT while running where doing AOT wouldn't help since AOT uses more storage.

  • @guruprasadkm
    @guruprasadkm 2 роки тому +1

    What an excellent explanation! Thanks Gary!

  • @sparavindan
    @sparavindan 2 роки тому +1

    Thanks Gary....very informative.

  • @El.Duder-ino
    @El.Duder-ino 2 роки тому

    Thank you for the explanation Gary👍

  • @jasonbaker5430
    @jasonbaker5430 2 роки тому

    Your videos are excellent! Very Informative!

  • @ne0tic
    @ne0tic 2 роки тому

    Great explaining man!

  • @coolpoete
    @coolpoete 2 роки тому

    Great video! That clarified alot for me

  • @Garrettdx1988
    @Garrettdx1988 2 роки тому

    This was a great video. Looks like I've found a new channel to binge

  • @alexk7977
    @alexk7977 2 роки тому +1

    Such a good explanation!

  • @antiechelon
    @antiechelon 5 місяців тому +1

    You just came to the major point in the beginning 👍 respect to you Gary.

  • @itsmuhammad2305
    @itsmuhammad2305 2 роки тому +2

    Great video professor.
    BTW would you make a video about the speed of RAM and how many channels can we have on an SOC?

  • @Atokxn
    @Atokxn 2 роки тому

    Thanks for the explanation !

  • @Mitorafer
    @Mitorafer 2 роки тому

    Thank you very much! Very informative

  • @btrsl
    @btrsl 2 роки тому +34

    Gary you're the best! Hope you'd do C programming content again.

    • @GaryExplains
      @GaryExplains  2 роки тому +6

      What subjects in C would you like covered?

    • @ko-Daegu
      @ko-Daegu 2 роки тому

      @@GaryExplains or maybe even rust
      what do you think if we rewrite stuff on rust is it true that rust will just magically make everything faster what if swift runs on rust runtime, not obj-c ? for example
      I think that's can be interesting

    • @btrsl
      @btrsl 2 роки тому +3

      ​@@GaryExplains Not basic C tutorials but like using C on low level stuff maybe? Or comparing C with other languages on some specific task? I really like how you show some stuff and you tell what can be done more and you leave it and it makes me to try out and continue. Multithreading, ipc, network programming stuff seems scary to all of us, maybe you can make a few videos on this topics? I don't know, whatever you upload, it's great but watching you coding is kinda cool.

    • @GaryExplains
      @GaryExplains  2 роки тому +5

      Did you watch my two videos on Piccolo OS?

    • @btrsl
      @btrsl 2 роки тому +2

      @@GaryExplains I don't know how I missed that videos, they're great!!!! I'll definitely watch deep down and try out more stuff!

  • @taher9358
    @taher9358 2 роки тому +9

    Hi Gary, can you give us an update on the modern chips on how they are performing and where they are heading after the new Exynos comes out mate?

  • @lukasandrltu
    @lukasandrltu 2 роки тому

    Thanks for the great video!

  • @cunnyman
    @cunnyman 2 роки тому +3

    I remember my iPhone 4S able to save games minimized for weeks and the games never got killed. Now? My iPhone 11 Pro Max killed my image viewing apps like 5 mins after minimize and my games instantly when I accidentally swipe it away haha. It's so much less reliable now. Going back to home screen now doesn't feel like minimize, feels more like ending task.

  • @siddharthsingh92
    @siddharthsingh92 2 роки тому

    Love you Gary. ❤️

  • @vervetech9395
    @vervetech9395 2 роки тому +2

    Lots of people say "optimized" without understanding it. It's like a buzz word. Very informative video

  • @mikldude9376
    @mikldude9376 2 роки тому +4

    Great video Gary , very informative , and this explains some of the inconsistency when doing speed test on different phones .

  • @Jur1_00
    @Jur1_00 2 роки тому

    Thanks for this explanation

  • @victor_okpala
    @victor_okpala 2 роки тому +2

    Probably my favorite channel on UA-cam I love knowledge

  • @chujorobj
    @chujorobj 2 роки тому

    This is best explanation I have seen.

  • @andyH_England
    @andyH_England 2 роки тому +19

    Thanks. Yes, when iOS and Android were devised each had a decision to make and Apple went their way and Android, was aimed as an open source. I feel that each has pros and cons making that decision and one of these is that iOS is lighter on RAM. It has been noticeable since the early days. I think for the vast majority this is not an issue going forward as 6-8GB of RAM on Android will be fine for most users. More a concern for me is how OEMs manage the RAM, seemingly conserving battery over user experience. My S20U has 12GB of RAM and even when most is used I do not see an issue with battery life so I do wonder about the cost benefits of this intrusive RAM management.
    I do not need all the Android benefits so I do appreciate how well iPhones now handle RAM, though it was a lot more hit and miss a few years back.

  • @truthseeker6804
    @truthseeker6804 2 роки тому

    You earn a sub for the good work.

  • @benjamindepaz8429
    @benjamindepaz8429 Рік тому +2

    This was a really nice analysis. But it only considers a piece of the problem. You’re addressing the effect of native code vs JIT, and how the runtime, kernel, and executables affect RAM usage. The other bit is the SDK and how well it’s written and optimized. It’s difficult to compare two apps on two platforms and their effect on RAM usage because the code based and underlying frameworks are different. As you pointed out, apps that are games that are built on common underlying frameworks that work close to the metal…they’re closer together. They don’t rely as heavily on system UI frameworks. But other apps that DO rely on a lot of system UI frameworks and designs have a bigger divergence. I am an iOS and an Android developer. I admit I’m not a knowledgeable about underlying implementations of Android ‘Widgets”, but having developed for iOS for over a decade, I can say Apple has a lot of optimization techniques for their frameworks. For example, cell prefetching for TableViews and Collection views. That doesn’t relate to RAM as much as Disk and Network IO, but the point is, they put a lot of thought into optimization. And because they own the whole device stack, they can do a lot with that. Back to RAM, iOS makes more and more use of Value types in the SDK. In many cases these value types can drastically reduce memory usage because they can go directly on the stack and not incur heap memory allocation. Even value types like string (which implicitly require heap allocation because the string could be huge), actually have a “Small String Optimization” where it can squeeze small strings in line on the stack and not allocate a heap backing store. Being on the stack also means the values are created and destroyed pretty efficiently and don’t linger around consuming RAM. Even Arrays, if their contents are structs and can be stored in-line, can avoid creating a heap buffer entirely. In Java/Kotlin, outside of what they call “primitive types”, all of their stuff is an object and has to be allocated and then garbage collected. That’s why for a time - maybe still do - they discouraged using Enums and instead preferred integer constants because it consumed less RAM. Swift doesn’t have that problem since Enums are a value type and is created on the stack. Kotlin arrays are also reference objects which I can’t stand.
    Again, I’m not as knowledgeable about android SDK, so some of these things might be a little out of date. But the point is you can’t just talk about the runtime and the compiler, when talking about ram usage and say that optimization has nothing to do with it.

  • @localblackman427
    @localblackman427 2 роки тому

    This is the most important video in ios and android ram dialog of all time. Should be a precursor to even having a conversation about RAM

  • @SoulRipper
    @SoulRipper 2 роки тому +21

    Great video! It's a relief that most games are native on Android. And it's surprising to see interpreted code apps giving native apple apps a run for it's money.
    As an android fan it absolutely kills me to know that no one will ever make native versions of apps. But this approach is the reason why android is widespread. Basically all android manufacturers dont have to worry about designing an OS from scratch, and deploying apps becomes simple. There are tons of benefits of this approach. And at one point, when processor become truly powerful, it will be a turn-off for devs to go for native approach

    • @JoshuaPack
      @JoshuaPack 2 роки тому +10

      Flutter is getting very popular and builds in native code with very little overhead. If we see more developers build in flutter we will see better apps too, and I there is a rise in that.

    • @hermanstokbrood
      @hermanstokbrood 2 роки тому +2

      Calling it interpreted code is not exactly what is going on. JIT or AOT compiling are not the same as what an interpreter does.

    • @hermanstokbrood
      @hermanstokbrood 2 роки тому

      @@JoshuaPack Google launches too many new development tools if you ask me. Kotlin is Google's best attempt so far.

    • @florianfelix8295
      @florianfelix8295 2 роки тому

      Android is still just a gobbled Linux. They don’t have to stick to that ;)

  • @hamzahineidi
    @hamzahineidi 2 роки тому +1

    You are just brilliant .

  • @truthseeker6804
    @truthseeker6804 2 роки тому +5

    Extremely good test, and I like how you’re very neutral about it all. Keep it up.

  • @melgross
    @melgross 2 роки тому +5

    Something about Java portability that wasn’t mentioned, is that Java needs to run on all the OSs that it’s intended to. Therefor, the features it may support on each platform will be those that are commonly found on all of them. Often,, features that are found on one, but not others, aren’t supported. So you get a neutered result, and that’s one objection to Java. Of course, if apps for Android aren’t intended to be portable, and not all Java apps are, then you will get Android’s features, but it has to be used on Android, unless another OS is developed specifically to duplicate Android’s functionality.

  • @9SMTM6
    @9SMTM6 2 роки тому +4

    Aside from the JVM, which IMAO should go away for mobile devices, I think it might also be relevant that the JVM, or at least all languages I know to run on it, are Garbage Collected, while Swift and Obj-C are reference counted.
    Garbage collection tends to just eat up RAM until a limit (per App, this is not related to OOM behavior of the OS), only after which it checks what objects can be deleted.
    Considering that most apps you looked at were in the 200-300MB range that might also be relevant here.
    Im not certain how this relates to code that went through the JIT or AOT compilation.
    Also, while I think Kotlin fixes many of the issues with Java, it often not only costs performance, but also memory and especially binary size.
    Many of the features that Kotlin has, will just get compiled to some inline code at invocation spot, instead of seperate functions.

  • @ALLUK633
    @ALLUK633 2 роки тому

    thank you buddy

  • @snugbreezy4523
    @snugbreezy4523 2 роки тому +5

    I'd love to sit down over coffee and discuss my love of all things smartphone with you, Gary. It would be a tech nerds, like me, dream. Lol. Good work my friend

  • @parthapaul4306
    @parthapaul4306 2 роки тому +10

    dude its not 70% larger than i phone its actually 300%
    in case of ebay you should calculate (300 - 69)/69 *100% = 335%
    but i guess you calculated as (300 - 69)/300 *100% = 77% which is wrong

    • @martinhalva72
      @martinhalva72 2 роки тому +1

      Exactly, I don't understand how it could be only 70 % when the apps shown in the table were about twice or even three times more memory hungry for Android.

    • @JoshuaPack
      @JoshuaPack 2 роки тому +1

      He meant to say iOS is 70% less

    • @martinhalva72
      @martinhalva72 2 роки тому +3

      @@JoshuaPack But then all the recommendations how much you need RAM for Android vs iOS is not correct as well.

  • @hermanstokbrood
    @hermanstokbrood 2 роки тому +8

    Nice to see someone doing some research to explain what really is going on. Thanks.

  • @ahrooranravindran2601
    @ahrooranravindran2601 2 роки тому +7

    can you please do how the jit and ahead of time compilation happens in android specifically? like an in depth analysis on different techniques used in java to make code run as natively as possible

    • @GaryExplains
      @GaryExplains  2 роки тому +12

      Nice idea, but too niche, I think.

    • @ahrooranravindran2601
      @ahrooranravindran2601 2 роки тому +1

      @@GaryExplains not really. Many android app devs follow your channel. It would be great if we know how internal systems work on android.

    • @GaryExplains
      @GaryExplains  2 роки тому +8

      As I said, nice idea, it would be interesting, but I have all the stats and analytics at my fingertips and I know it is too niche.

    • @mullergyula4174
      @mullergyula4174 2 роки тому

      @@GaryExplains You are the boss :D Maybe you could make a video about us, viewers. Who we are, what are we interested in.

  • @MegaWunna
    @MegaWunna 2 роки тому +3

    I have a galaxy s21 ultra the 12 gig model it's really good so much so it rarely kill apps to save ram memory

  • @Shubhm_Verma
    @Shubhm_Verma 2 роки тому +3

    Hey Gary, can you compare Gpay native and Gpay flutter RAM usage in android ? I noticed since few updates, Gpay is now based on flutter.

  • @nitrovenom991
    @nitrovenom991 2 роки тому +4

    Running adb shell cmd package compile -m speed -f (app package name here) seemed to reduce app memory usage for me.

  • @living_curious
    @living_curious 2 роки тому +4

    Great video, but what about the ram hardware itself? Iphones in general give the latest hardware tech best overall compatible. Wheres for Android due to such a large number of smartphone brands one has to be always sceptical going from product to product irrespective of coarse specifications. There are so many dram products with varying performance but same overall memory size.

    • @vivek_v
      @vivek_v 2 роки тому +3

      The iPhone 13 Pro only have DDR4X ram while the Galaxy S22 Ultra has DDR5. The performance difference is not significant on a phone, but there are slight power efficiency improvements with DDR5.

  • @Metalfreak327
    @Metalfreak327 2 роки тому

    Wow I was looking for the answer to this question.

  • @ChrisVogtmann
    @ChrisVogtmann 2 роки тому

    Gary, can you do a video on how well or how easy it is for apps to take advantage of saving the state you are in with an app when it is killed and then you go back to it and you are loaded right back to where you were but in reality the app needed to reload from scratch. Or is that only when an app goes to the background?

  • @Hectorszenshopedc
    @Hectorszenshopedc 2 роки тому

    I knew it... You nailed it on the wall of YT Videos

  • @floppa9415
    @floppa9415 2 роки тому +21

    Most Android Apps often can run on different CPU architectures out the box. Which is extremely neat.

  • @ephraimedits
    @ephraimedits 2 роки тому +3

    I got annoyed by Xiaomi's MIUI Android skin for always killing my apps in the background after several minutes of not using them ....

  • @lorenzomijorus
    @lorenzomijorus 2 роки тому +23

    Hi Gary.,
    I have seen the same app, in the same conditions in foreground (so no background tasks) on two different android devices that I have requiring very different amount of RAM, at least according to android's task manager. We are not talking about games here, where the tier of the device could make a difference, but productivity apps.
    Could it be that some apps adjust their memory requirements based on the amount of free ram? Say I have a 12gb phone, Google photos might have no problem loading some off-screen thumbnails in memory

    • @Vardiak
      @Vardiak 2 роки тому +11

      Java uses garbage collections to free unused memory. Basically, it periodically scans all variables in a program and frees memory for unused ones. This process requires CPU, so whenever it cans (ie you have a lot of RAM), it will try to run it as rarely as possible, to maximize performance. This is why apps typically consumes more memory if you have a lot of RAM on your device.

  • @jinx3709
    @jinx3709 2 роки тому +1

    I'm pretty sure you've said before iOS actually pauses an instance of an app when you swipe away from it and it does more compression while in the ram than Android because it's garbage collection is not that efficient compared to iOS.
    The thing I could understand that, there's always a tradeoff, you want your device to be most efficient then you're losing accessibility because you have to optimize for that specific set of hardware, you're kinda locked or you're losing efficiency for accessibility, whatever hardware it is it will run anyway.

  • @nothing9220
    @nothing9220 2 роки тому

    Excellent.....

  • @uzairm6865
    @uzairm6865 2 роки тому

    Best explanation.... 👌

  • @Truth_Seeker09
    @Truth_Seeker09 2 роки тому

    Superb Sir!!!👌👌👌 PLEASE MAKE COMPARISON VIDEO OF BATTERY CONSUMPTION BETWEEN ANDROID AND IOS.

    • @GaryExplains
      @GaryExplains  2 роки тому

      A general battery comparison video isn't possible there are just too many factors. There are so many different Android devices with different battery sizes, processors, screens, etc. Just not possible.

  • @rintintin_
    @rintintin_ 2 роки тому +5

    I’m curious about how cross platform apps compare in terms of size and memory i.e flutter, React Native etc

    • @snowfox7739
      @snowfox7739 2 роки тому

      From my experience so far, I notice that apps made specifically for iOS tend to run better without warning my phone up or draining my battery while cross platform apps are usually a tossup. Once again just my experience since I’ll never be able to run every app out there.

  • @pqsk
    @pqsk 2 роки тому +1

    We need a video about the speed of the devices. Also what about the Purism- Librem devices?

    • @GaryExplains
      @GaryExplains  2 роки тому +3

      I have loads of videos about the performance of these devices. I guess you are new here... Welcome... You should also check out my Speed Test G UA-cam channel.

  • @tevinjordan2118
    @tevinjordan2118 Рік тому

    Just how you did speed test G I would appreciate seeing what phones on the market are so aggressive with killing apps to not utilize available ram in favour of swap memory..why do this? Is it a power saving tactic?

  • @theJesai
    @theJesai 2 роки тому

    Epic video :)

  • @nokiafanboy500
    @nokiafanboy500 2 роки тому +5

    Great video Gary !
    Question: If Java based implementation takes more memory, why can't Android switch to something similar to iOS to reduce the memory usage. People in many countries use android more than iOS and lot of them have very less memory. Switching to less memory option will make all these smaller android phones look/run faster and remove the perception of less optimized phones and less lag/stutter. Is this in works (like fuchsia) or is Android too big to move away from Java?

    • @sireajeel5009
      @sireajeel5009 2 роки тому +12

      u missed the part where gary explains why java is great

    • @korgmangeek
      @korgmangeek 2 роки тому +7

      Easier for programmers. Less things to learn.
      Memory is cheap those days, no reason to distract this environment. Before 2012 was a problem.

    • @ej.xxxx_
      @ej.xxxx_ 2 роки тому +5

      Android AFAIK is about a decade old, switching suddenly to another programming language will take a tremendous amount of work and money. Imagine all apps on play store being rewritten into something like Go or Rust, and all phone companies (Samsung, Xiaomi, Asus, Oppo, etc.) switching their own build of Android into another programming language. It ain't gonna happen anytime soon

    • @yodesuyo
      @yodesuyo Рік тому

      programmers on native languages needs to write more lines for memory management unlike in JAVA.

  • @ko-Daegu
    @ko-Daegu 2 роки тому

    would you please make a video on rust and how it can affect topics like these?
    for example:
    - what do you think if we rewrite stuff on rust is it true that rust will just magically make everything faster what if swift runs on rust runtime, not obj-c ? for example
    also is it possible for devs to compile directly to ARM assembly maybe in the future can languages do that is there's a way to ship the code with the machine language so less compiling is indeed is that even possible?

  • @Pyriold
    @Pyriold 2 роки тому

    Even when playing big games it's really no problem for smaller RAM machines. It's just a few seconds, you probably won't notice it at all.

  • @harryofficial3743
    @harryofficial3743 2 роки тому

    Hey gary can u make one video on windows vs mac ram management

  • @nilloviz
    @nilloviz 2 роки тому +2

    Excellent video. One question, how come games can be written natively and apps cannot on Android?

    • @GaryExplains
      @GaryExplains  2 роки тому +5

      The official way to write Android apps is using Java/Kotlin. However you can also write native apps using toolkits like Flutter. Since Flutter is cross-platform and from Google then it is a good way to write native Android and iOS apps using one code base.

  • @chrisarmstrong8198
    @chrisarmstrong8198 2 роки тому +7

    Since each different processor requires its own unique Java Virtual Machine anyway, why not just have a Java compiler for each different processor that generates native code directly ? The high-level Java code would still be the same in both cases, so what's the benefit of the JVM ?

    • @mthf5839
      @mthf5839 2 роки тому +3

      The JVM is faster than compiler+native run

    • @andrebrait
      @andrebrait 2 роки тому

      That's kinda what the JVM will do anywy with JIT. It takes the bytecode and compiles it to native machine code on the fly (just-in-time) for execution.
      Talking about the HotSpot JVM here, it usually does that after a given piece of code has been executed a few times, because doing that for every piece of code is expensive and doing that for a method that one runs once, for example, is not needed.
      AOT compilation for Java and also compilers/frameworks that generate native machine executables (think GraalVM) do exist, but they have their caveats too.
      One advantage of JIT compilation is being able to optimize the JIT-compiled code to the machine you're running it on, without function multi-versioning and other things that can be used in traditional compilers.

    • @andrebrait
      @andrebrait 2 роки тому

      Other benefits is not having to embed the code for the garbage collector into every binary, for example.
      That's what Golang does, IIRC. Every Go-compiled program has a copy of the garbage collector inside it.

    • @rubbish9231
      @rubbish9231 2 роки тому

      See i give you Proper answer. You can make native Compiled 1-1 apps for both processors and will run smooth on both of em. Now make 100000 apps. Or SHIFT them to another processor. here you dont have to worry about transferring 100000 apps to another architecture. Male make a good JVM it runs. JAVA IS SECURE AND PORTABLE.

  • @taidee
    @taidee 2 роки тому +5

    Unfortunately, if a system is capable of doing the same work over the same period as the other one while requiring less resources, then that system is certainly a more optimal solution. In cars this would be like a normal hatchback vs crossover SUV on a similar platform, the suspension for the SUV is always going to be a bit more complex and thus expensive because the SUV has higher centre of gravity (it's top heavy), it needs more to maintain the same stability as standard hatchback.
    So the people shouting optimization on iOS are not totally wrong even though they are not getting technical reasons correct. I use and like both systems by the way so I'm not taking sides here. I also use Linux and Windows, I use each system for what my workflow requires at the time.

    • @MaryamMaqdisi
      @MaryamMaqdisi 2 роки тому +1

      I think both solutions are tackling different situations. In the case of iOS, because Apple has total control over the hardware, and the hardware is limited to a very small selection of devices, they can afford to focus their efforts on compiling to native code that can be efficiently run in their platform. Android meanwhile exists in many different versions across thousands of different devices (different chips, different screens, different cameras, you know what I mean), so using something portable like Java is very smart to try to run it everywhere. So it's not less efficient for their use case: they efficiently fix the issue, making apps available throughout their fragmented Android versions.
      Also, I don't particularly like either iOS or Android either, I'm just voicing my thoughts on this subject. I personally run Linux on my desktop and I wish I could do away with phones entirely lol.

  • @khy8358
    @khy8358 2 роки тому

    Gary please make Video comparing the differents level of multitasking android ios and desktop can handle in software level I mean comparing
    What Os manage multitasking more efficient
    Desktop Os an android are only one with background processes running

  • @OroborOSX11
    @OroborOSX11 2 роки тому

    I’m not so concerned about memory usage as I am performance. There’s just some stuff that isn’t possible with an interpreted environment, even for non-games.

  • @khy8358
    @khy8358 2 роки тому

    It is posible to do a speedtest g with app that consume the same amount on ram in both os I mean if twitter consume 300mb replace it with another android app that use the same 300mb will be insteresting to see how ram managements works in real life if is there's an optimization thing exists

  • @doncallahan403
    @doncallahan403 2 роки тому +3

    +Gary Explains I have a particular app that my Galaxy Z Fold2 just absolutely refuses to keep it RAM, called 'Taimi'. The only way I can keep it in RAM is if I force it to by pinning the app in RAM. Why with a phone with so much RAM refuses to keep an app In RAM. I have caught this app taking up as high as 400MBs of RAM.

    • @someoneyouneverknow7529
      @someoneyouneverknow7529 2 роки тому

      Yeah some apps refuse to be in RAM

    • @doncallahan403
      @doncallahan403 2 роки тому

      @@someoneyouneverknow7529 I don't know if it's the app, or the phone itself being to aggressive.

    • @mohammedalharbi5970
      @mohammedalharbi5970 2 роки тому +1

      You can go to settings then apps, then your particular app, then memory, then select unrestricted for

  • @Eugensson
    @Eugensson 2 роки тому +1

    Why wouldn’t google push for arm native apps on android?

  • @aared
    @aared 2 роки тому +1

    13:45 I wanna try Ginseng Impact

  • @Sk-lm3kv
    @Sk-lm3kv 2 роки тому

    How about power consumption difference between iPhone and Android?

  • @ekeretteekpo3004
    @ekeretteekpo3004 2 роки тому

    What does it mean that they are bigger in memory on Android? Is it that they just stay in that memory or only when they are launched and in use?

  • @jasonmajere2165
    @jasonmajere2165 2 роки тому

    iPhone 6 with 1 gig and larger screen was a issue, on top of bendgate.

  • @mayursoni3811
    @mayursoni3811 2 роки тому

    Tis is such an informative video. I am surely going to share this with my friends and peers. People should know this information. Thanks a lot for this video.

  • @plutack
    @plutack 2 роки тому +1

    Tech made easy by Prof Gary

  • @nilloviz
    @nilloviz 2 роки тому +1

    Could it be compared to spoken languages? iPhones only communicate using e.g. Chinese, thus all apps must be compiled using Chinese. Android phones also natively speak Chinese, but has a translator (Java) so that different languages can be used for convenience, but the translator needs to translate into Chinese for the phone to understand. Correct?

    • @Henfredemars
      @Henfredemars 2 роки тому +1

      I think this is a good comparison. The translation layer helps make Android apps more portable, but that also means extra work translating as you use it (JIT/interpreter), translating in advance (AOT), and always you still need the translation books on hand which requires more storage (Java/JVM).

  • @pdr770
    @pdr770 2 роки тому

    The RAM and GPU and Cellular in iOS and MacOS will use Less Code , work in SaC. In killer Startegy in iPhone 14. Even with invesible Blocks of Codes in great idea for 50% improve GPU with more Vattery with Best Teams and Execs that report Daily to Craig and , and to Tim even in AirPods and Apple Glass, for more Battery. Also in Tesla.

  • @techandy1747
    @techandy1747 2 роки тому

    Quick question does more Ram consume more power??

  • @1MarkKeller
    @1MarkKeller 2 роки тому +2

    *GARY!!!*
    Good Morning Professor!
    Good Morning Fellow Classmates!
    Stay safe out there everyone!

  • @ScandalCuracao
    @ScandalCuracao 2 роки тому +2

    Even if Android uses bigger MB on Ram usage. Still I like Androids way of Keep the App Loaded in the MEM. I HATE that  Keep Closing/Killing the App. Apple is so Annoying regarding that.  does it “Almost” right away.

  • @matt43121
    @matt43121 2 роки тому

    Why Android chose to use the JVM for such a low powered system still confuses me to this day. The tight integration with the Android APIs take away lots of the portability that you usually get when you use something like the Swing API. Very puzzling.

  • @mohammedshafi4970
    @mohammedshafi4970 2 роки тому

    Android apps (games) closing too fast
    iOS never closes the app is there any solution

  • @auttumagar
    @auttumagar 2 роки тому

    Andoid should do something about the ram management

    • @GaryExplains
      @GaryExplains  2 роки тому

      What is wrong with Android's RAM management. Did you watch my other two videos on this subject?

  • @FallingESP
    @FallingESP Рік тому

    So the good job that apple do is to make all as efitient as possible avoiding unnesesary procceses like this intermediate java translator. And all of that is reach by hardware and software engeniering that allow then to build a CPU that can run the code natibly as you said.

  • @The.Man.WithAPlan
    @The.Man.WithAPlan Рік тому +1

    They really need to fix apps refreshing. I can use a phone with 8 gigs of ram or 12. Apps still refresh, which is very annoying. They really need to optimize the operating system it's self so it better utilizes and benefits from more ram. A 12 gig or even 16 gig phone apps should not refresh nearly as much as 8 gigs. Android.

  • @lexsoft255
    @lexsoft255 2 роки тому

    What's you're daily driver?

  • @korgmangeek
    @korgmangeek 2 роки тому +1

    I think you made a mistake at 07:10. According to your comparison at 05:40, 6G of iOS is not 8G (x0.5) on android but equivalent from 12G (x2) to 24G (x4).
    The conversation about RAM in 2022 I think it's out of topic. It was a good subject when devices had 1-2G RAM. Nowdays it's not a problem to be analyzed.
    I thought that SWIFT was bloatware like Java. It's a surprise to me that it has lower demands on memory.
    My iOS has 2G of RAM and runs fine. 1G RAM is a problem for iOS from 2019 but still usable if you have patience.

  • @plutack
    @plutack 2 роки тому +4

    What improvement can be made to android os without necessarily a total rebuild if there is any? Or are we stuck with this since it's like the foundation of android

    • @GaryExplains
      @GaryExplains  2 роки тому +6

      Unless Java is removed, nothing can be done.

    • @Aygross
      @Aygross 2 роки тому

      The foundation of android is Linux so kinda not much to do at this point lol.

    • @ko-Daegu
      @ko-Daegu 2 роки тому

      @@GaryExplains is kotlin any better or can it be better in the future?
      can oracle rewrite some stuff in rust and is that even helpful ?

    • @GaryExplains
      @GaryExplains  2 роки тому +9

      Java and Linux aren't tied together and Android's RAM usage has nothing to do with Linux.

    • @GaryExplains
      @GaryExplains  2 роки тому +7

      Kotlin just compiles to Bytecode the same as Java.

  • @TheMeaningofHaste
    @TheMeaningofHaste 2 роки тому

    I don't know if you can safely make a direct comparison between the two, as both operating systems use available RAM in very different ways. For example, iOS uses memory compression for all the apps running on the system and android apps, by design of the OS, may end up using different amounts of memory on different device configurations (harware SKUs and android versions).

    • @GaryExplains
      @GaryExplains  2 роки тому +2

      We can safely make any comparison we need to because a) I tested several different Android devices b) this is about user experience, so it is irrelevant if things are slightly different, the result is what matter c) Android uses compression for all the apps running the system as well d) Android tends to use more compression than iOS.

    • @TheMeaningofHaste
      @TheMeaningofHaste 2 роки тому

      @@GaryExplains I didn't mean to question your testing methodology (sorry if it came out as such), all I'm saying is that yes, while Android apps report more memory usage, it's entirely possible that you may have the same exact user experience between two devices with 6GB ram, one running android and one running iOS. It's all about how the OS uses memory and not that one OS "needs" more memory than the other.

    • @GaryExplains
      @GaryExplains  2 роки тому

      I am talking about how the OS uses the memory.

  • @kushagrabhavsar7327
    @kushagrabhavsar7327 2 роки тому +2

    but but "optimisation "

  • @imabot7495
    @imabot7495 2 роки тому +1

    And then comes custom UI on android taking up 3GB of memory in android.

  • @abdullakc
    @abdullakc 2 роки тому

    U didnt talk about battery management and which OS consumes more battery

    • @GaryExplains
      @GaryExplains  2 роки тому

      That is because this video is about RAM not battery.