Slashdot Mirror


Ask Slashdot: Getting Apps To Use Phones' Full Power?

First time accepted submitter MurukeshM writes "I have a 16 GB Nexus 4. I rarely manage to push the RAM usage above 1 GB (not counting cached processes). Yet I find it increasingly annoying when apps do stuff to save on RAM usage, such as having a browser reload a tab if I havent used it for a long time, instead of keeping it in memory or have an ebook reader load from storage instead of keeping the entire eBook in RAM. I know there are plenty of phones with far less memory, but when most of the RAM is unutilized, with more and more phones and tablets having 1GB+ RAM, isn't it time that apps check on available RAM and use optimizations accordingly? And it isn't only about RAM. Android by default only downloads one thing at a time, whether it be an app from Play Store or a file from a site. When connected to WiFi or 3G/LTE, there's no reason why multiple simultaneous downloads shouldn't be used. How do Slashdot readers with high-end phones get the most out of their device? Are there custom ROMs which act more sensibly?"

26 of 184 comments (clear)

  1. That phone has 2GB of RAM by Anonymous Coward · · Score: 5, Informative

    The 16GB Nexus 4 doesn't have 16GB of RAM. It has 2GB. Your post reads like you think it has 16GB of RAM.

    1. Re:That phone has 2GB of RAM by adycarter · · Score: 3, Interesting

      exactly what I was just about to say.

      The 16gb in your 16gb Nexus 4 is internal storage memory.

      It has 2gb of Ram

      --
      Witty Comment Here
    2. Re:That phone has 2GB of RAM by interkin3tic · · Score: 2

      I disagree, I think it reads like he's simply specifying which exact model of phone he has.

      He also points out that it rarely goes above 1 GB ram, so it would seem he was actually checking the ram and not storage capacity. And that screen would inform him he has 2 gb ram, not 16. And 2 or 16, it still evidently doesn't use most of it.

    3. Re:That phone has 2GB of RAM by jeffmeden · · Score: 4, Interesting

      Also, my Nexus 7 certainly seems to download multiple files at once.

      This. Certain apps (like the play store) download one at a time because they are trying to be nice on your phone (since the time saved from multiple downloads is negligible anyway, unless you have a really good 4G signal). How much time do you spend waiting on play store app downloads anyway? The OS at large has no such restriction, you can download things from the play store while you are downloading things from a web page, or things from a Torrent, or whatever; it is all up to the app. I have run a Torrent client with 32 connections across 5 file downloads and Android had no problem with it (it did make video playback skip occasionally). I agree that phones are generally more powerful than the software expects at this point, but the way the question was worded, this is a problem looking for a solution.

      How about this: How can I get my phone/tablet to do compute work (folding @home, whatever) when it's plugged in and fully charged (like, most of the night)? These devices have multiple GB of ram, 2 to 4 CPU cores, and 4 to 8 GPU cores, why not put them to work if they are on-charger and full of juice (when the charger's role is done)?

  2. Summary a bit confusing... by bondsbw · · Score: 3, Insightful

    Just a note for future articles:

    I have a 16 GB Nexus 4. I rarely manage to push the RAM usage above 1 GB

    There is no need to include "16 GB". Both devices have 2 GB of RAM. To someone who doesn't know this, the summary might imply that they have some awesome 16 GB RAM model.

    --
    All my liberal friends think I'm a conservative, all my conservative friends think I'm a liberal.
  3. Wrong by egcagrac0 · · Score: 2

    When connected to WiFi or 3G/LTE, there's no reason why multiple simultaneous downloads shouldn't be used

    If bandwidth is finite, serializing downloads means one finishes first, and can be used while the others download.

    You're right on the RAM usage, however - particularly with eBook readers. It's reasonable to keep them in-RAM, or at least keep enough in-RAM so you can turn a few pages forward or back without loading.

  4. The problem with ram by Anonymous Coward · · Score: 4, Insightful

    The problem with ram is that you can't do that. Unfortunately traditional apps live in a world where memory can't be "taken back". By taken back I mean that precisely as you request, an app could have a minimum requirement of 10MB, but maybe it could cache stuff for 1GB. However, there is no easy way to the OS to tell the app politely "hey, may you please give back as much memory as you can because something else needs it?". The problem is two fold for mobile apps: they may be "thawed", so they are not really executing to save CPU, so they can only be asked if they are currently running. And second, the memory another app is asking, is it because it requires that memory to work, or it also wants to create a big cache of discardable stuff? You see, malloc et all don't have an option to say "I want this much memory but I don't really need it, so don't purge other processes form memory if there is none available".

    The end result is OSes have to deal with killing apps to free memory because they end up over allocating memory. And especially if you consider all of the above to be for well behaved apps, you can surely understand apps could DOS your OS if they could get away with hogging available memory for themselves...

    1. Re:The problem with ram by digitalvengeance · · Score: 2

      In addition to the system-level stuff, Android's SDK also provides a callback that apps should implement for exactly that reason.

      http://developer.android.com/reference/android/app/Activity.html#onLowMemory()

      The system calls it when it needs to reclaim some memory and apps are supposed to discard whatever they can in order to return memory to the system.

      --
      How many roads must a man walk down? 42.
    2. Re:The problem with ram by michelcolman · · Score: 2

      IOS does, through the NSCache interface. You can allocate as much as you like, and the OS will automatically get rid of it if it needs to. Also, your app can respond to low memory warnings so it can free up memory before being forced to quit completely.

  5. cyanogenmod by admdrew · · Score: 3, Interesting

    I run Cyanogenmod on all of my Android devices (currently Galaxy Nexus for my main phone, Nexus 7 tablet, and an older HTC G2 phone for playing around with), and have never looked back.

    As others have mentioned here, though, sounds like you may not fully understand what's going on, since the Nexus 4 doesn't have 16GB of RAM, and we all seem to be able to do multiple downloads at once.

  6. Re:Confidant! Not Cosmonaut You Stupid Git! by geminidomino · · Score: 2

    Two things:

    1: The poster is fully aware of the proper lyrics. It's a copypasta troll, and you just swallowed the hook down to your kidneys.

    2: Of course Betty's next. She's the last one.

  7. Re:Ferrari by Chrisq · · Score: 5, Funny

    Dear Slashdot:

    I bought this Ferrari and I live in a suburban part of the US. I can't drive it over 70mph on the highways and I'm constantly in stop and go traffic in the city. It's so frustrating!

    Can anyone of you tell me how to get the most out of my car?

    Sure, Dress in a flashy suit then drive slowly (20mph or less) past a hangout of hot babes. Then go in and ask "anyone fancy a ride?".

  8. Force stopping 'Running Apps' from 'Switch Apps' by SternisheFan · · Score: 5, Informative
    A little OffTopic about Android's 'switch apps' feature (on ICS and higher) from a recent Slashdot discussion.

    I've learned that swiping the app offscreen to the left doesn't 'force stop' it, it just removes the icon from the 'running apps' list.

    Doing a 'long press' on the apps icon brings up a sub-menu of 2 options, "remove from list" and "app info". Tapping on the 'app info' shortcut brings you to the 'app info screen', from there the app can be 'force stopped'.

    I'm posting this here in the hopes that it'll clear up any confusion caused by that previous discussion. :-)

  9. Re:Read up on ARM by serviscope_minor · · Score: 2

    This is a platform that was not designed to have a scheduler carving up resources.

    What?

    It's a genersl purpose CPU which supportes full memory paging. It is *exactly* designed to support multitasking and have a scheduler carve up resources.

    Case in point: it runs Linux which on a GNU/Linux system does a very good job.

    In fact given that Linux ran on some even pretty early Archimedes machines it seems that ARM has had the appropriate hardware to run proper operating systems since not all that long after its inception.

    In other words: ARM and Linux are more than capable of it and are in fact very good at it. It's just that the android software is not great.

    --
    SJW n. One who posts facts.
  10. Re:On the other side by tlhIngan · · Score: 3, Interesting

    Exactly. The problem with Android is that for every flagship nexus or SGS4 sold, dozens more crappy low end ones are sold.

    The free phones. The ones with crap screens, crap processors, and/or diddly squat for RAM (though for Android these days, that applies for anything smaller than 4.5" screen, annoyingly). After all, Google claims about 1.3M daily Android activations, while the most popular Android flagship phone, the SGS3, has sold around 40M units in all its various combinations. That's barely a month's worth of Android phone sales.

    And possibly, ancient OS versions (heads up - Gingerbread is no longer the majority! Though it is by far the largest slice). So you can have apps that use all the power of the device (I've seen special edition apps restricted to certain devices), but most devs don't have the resources to maintain and test two or three separate sets of code bases and/or assets. Especially as a lot of the exclusives are often comissioned by the manufacturer who just pays for the port and no maintenance.

    So devs have to keep in mind the vast majority of phones out there don't have 2GB, or even 1GB of RAM, and have 1GHz processors if they're lucky. And maybe 320x480 screens. Or 5" 480x800 screens.

    Yes, Android has basically wiped out featurephones (more profitable, and carriers get to sell a very profitable data plan to someone who probably will be lucky to use 1MB out of their 100MB). (And stats show this - despite Android outselling iOS 3+:1, iOS data usage still beats Android 2+:1).

    It's like PCs these days - you can get a top notch PC with the latest graphics, but end up finding most PC games assume an Intel graphics accellerator or are ported from consoles. It just isn't that big a market.

    Then again, there's something to be said that the people who buy the flagship phones tend to be the heavier users, so ignoring the low end isn't that bad a strategy either. Why go for the 80% market when fewer than 10% of those probably would even see your app, but go after the 20% when 50% or more will probably buy it? (Generally speaking, it's the reasoning behind developing for iOS first).

  11. Re:It's Probably Up to the OS to Manage Resources by TheRaven64 · · Score: 2

    And it's up to well-written apps to provide hints. OS X / iOS has the NSCache interface, which allows you to store references to objects that may be destroyed in response to memory pressure (unless they are in use right now). This is important, because it allows an application to grow to use RAM when it's available, without dying horribly when it isn't.

    --
    I am TheRaven on Soylent News
  12. Ask Slashdot? by Fnord666 · · Score: 2
    Dear Editors,

    There is an 'Ask Slashdot' section for a reason. Please use it!

    Thanks.

    Fnord666

    --
    'The tyrant will always find pretext for his tyranny.' - Aesop's Fables
  13. Re:Read up on ARM by TheRaven64 · · Score: 4, Informative

    This is a platform that was not designed to have a scheduler carving up resources

    Uh, what? The ARM architecture was designed for Acorn's line of 32-bit desktop computers, which shipped with a multitasking OS from the start. Now, it wasn't preemptively multitasking, but the only difference between cooperative multitasking and preemptive from a hardware perspective is that you need (relatively) cheap timer interrupts to enable preemptive multitasking, and ARM has always had this.

    The cost of context switching boils down to a small number of things:

    • The cost of delivering the timer interrupt (interrupts on ARM are cheap and have a small number of aliased registers to play with so the code in the interrupt handler can be simple)
    • The size of the register set that needs to be saved (ARM is 15 32-bit GPRs, which can be saved and loaded in a single multi-cycle instruction, only x86 has a smaller register set)
    • The cost of TLB flushes and refills required during the switch (ARM has a tagged TLB, so you only need to invalidate any TLB entries when you recycle an ASID)

    In summary, the orifice that you are talking out of is not your mouth.

    --
    I am TheRaven on Soylent News
  14. And why do you think that is by SuperKendall · · Score: 2

    you can tell that charger isn't putting out the 1 to 1.2 or whatever Amps it does if an iPad was plugged in.

    And do you really think your Samsung charger would attempt to assassinate whatever was plugged into its USB port with way more amperage than the USB spec states will be delivered over the port?

    This is exactly why I think it's so absurd that people complain about "custom" connectors (never mind USB itself has about five!), when in order to charge devices in a reasonable time over an ancient standard, we instead live in a world of custom chargers that just happen to PRETEND to use the same connector type when they really behave differently depending of what is plugged into them.

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
    1. Re:And why do you think that is by hawguy · · Score: 2

      This is exactly why I think it's so absurd that people complain about "custom" connectors (never mind USB itself has about five!), when in order to charge devices in a reasonable time over an ancient standard, we instead live in a world of custom chargers that just happen to PRETEND to use the same connector type when they really behave differently depending of what is plugged into them.

      As long as they all default to a least-common-denominator "safe mode" that's compatible with whatever happens to be be plugged in, even if it's just at the standard 500mA rate, then what's the problem?

      I know I can plug my phone into any microUSB charger I can find and it will charge.

  15. Re:Ferrari by Nidi62 · · Score: 2

    You don't go to many lower income places, do you? I've seen sub $500 per month apartment complexes with Escalades, or cars with thousands of dollars worth of stereos and chrome parked in the parking lot.

    --
    The only thing necessary for evil to triumph is for it to be pitted against a slightly greater evil
  16. Re:I have better than 4G: I have Wi-Fi. by jeffmeden · · Score: 2

    Do you really get 50 mbit sustained through 4G? My downloads always start fast, then quickly drop down to a much slower speed - I've always assumed that my carrier is throttling me on big downloads... i.e. small 1MB things like web pages load fast, sustained downloads are throttled. Do people really get fast 4G speeds for tens or hundreds of megabytes?

    I'm on Verizon and I have had a few sessions of 100MB+ downloads running at top speed all the way. Granted, I am not in a spot with a 10 Mbit+ signal very often but when I am, it is blazing. Of course take this with a grain of salt; Verizon is both creative and clandestine when it comes to service shaping, so they could very well use that tactic in certain congested areas.

  17. Single digit GB/mo cap by tepples · · Score: 3, Insightful

    most people don't have anywhere near [50 megabit per second wired service] for their home/office, but can get it through 4G.

    A 50 Mbps downstream is fine for the first 800 seconds, after which it drops to 0 Mbps for the rest of the month because the customer has hit the 5 GB/mo cap. The advantage of wired is that the cap is 50 times as high: 250 GB/mo, not 5 GB/mo.

    you basically need to saturate the google server sending you the app

    It's not just Google Play Store. If I'm downloading a bunch of files through Chrome, I want to saturate multiple servers, most of which are not operated by Google.

  18. Re:Confidant! Not Cosmonaut You Stupid Git! by Samantha+Wright · · Score: 2

    What if you're the one being trolled, and that was actually the same poster? (Dun, dun, dun....)

    --
    Bio questions? Ask me to start a Q&A journal. Computer analogies available for most topics!
  19. Re:Force stopping 'Running Apps' from 'Switch Apps by charles2678 · · Score: 2

    It lives on only as a cached process, not as a live one. Those are reaped whenever anything else would use the resources they're using -- it's not _truly_ stopped, but it's a functional equivalent for all reasons that matter (unless it's your intent that your application lose all its state -- this can be useful if you're trying to clear a bug, for instance, but will have no effect on performance on the rest of the phone).

  20. Pathetically crippled. by spire3661 · · Score: 2

    When i talk about using my mobile or tablet as a small server for books, audio etc, people think that is silly. My phone is more powerful then the computer i used to host my IRC node in college, yet the idea of it serving anything (besides all the personal data it generates about me) is completely ignored. The entirety of mobile right now is bent on knowing EVERYTHING that goes on in the device, and you have no access to it. I have an iphone 4S and an Ipad 2. One has cellular, one doesnt. There is NO NATIVE WAY to transfer data from one to another. If i want to pull something off my server with the cell connect, i cannot then view it on my ipad. I find this extraordinarily unacceptable at this stage in mobile.

    --
    Good-bye