Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Android Cellphones Handhelds

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

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?"
This discussion has been archived. No new comments can be posted.

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

Comments Filter:
  • by Anonymous Coward on Tuesday March 26, 2013 @10:05AM (#43281015)

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

    • Re: (Score:3, Interesting)

      by adycarter ( 261257 )

      exactly what I was just about to say.

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

      It has 2gb of Ram

    • 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.
  • by bondsbw ( 888959 ) on Tuesday March 26, 2013 @10:06AM (#43281027)

    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.

    • Again, (see my comment above) apps can use both RAM and storage. And there's no reason why they should discard data. When running use as much RAM as you can, when not running, save everything to storage.

  • by egcagrac0 ( 1410377 ) on Tuesday March 26, 2013 @10:07AM (#43281041)

    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.

    • Since storage devices are now solid state and so much faster than the old mechanical disks, does it really matter for practical purposes, whether a few megabytes of data are kept in RAM or fetched from fast solid-state storage? I have recently upgraded my computer with an SSD. Loading massive multi megabyte files used to take a definitely span of time noticeable to the user, but is now loaded almost instantaneously. Since phones are small ultraportable computers, this applies to them as well. I used to put

      • by h4rr4r ( 612664 )

        The problem is instead of swapping the application out to disk, Android kills it. This means the application has to be loaded back up and loses its state. This means the web browser will refresh a page, which it was just on if you switched to another memory intensive application since you last used the web browser.

        • by Tokerat ( 150341 )
          Battery life is an issue. I'm sure there are optimizations, at least on some devices, which reduce power partially or completely to unused RAM to save on battery life...don't you need to send a refresh signal each clock pulse to keep RAM from losing what is currently stored? Seems like a waste to use the power on memory which isn't currently occupied, which in turn helps the phone operate longer. Also, minimizing bandwidth useage keeps your app (and your OS) in a favorable light with carriers. Of course,
        • ... would you prefer the full memory allocation of the browser to be swapped out to disk each time?? If you've got the number of tabs open that I normally have, that's a substantial amount of disk space being taken up (and free space on my phone is generally at a premium, it being one of the non-SD-card-compliant nexii ...)

          I'm sure you could write a browser that would do this, but I doubt many people would want to use it ...

          • by h4rr4r ( 612664 )

            Yes, I would. At a bare minimum the current active tab.
            The correct solution is to get a phone with 128GB of disk.

            • Oh, I'd take a phone with 128Gb storage, but I'm not sure it's going to happen any time soon. At least, not from Google while they're still pushing their stupid cloud storage concept ... :(

      • It's a less noticeable impact, but FLASH is still slower than RAM.
        • Not only that, most flash is considerably slower than even a slow hard drive - SSDs get their performance by operating many flash chips in parallel. The seek time is usually incredible which is great for reading tiny files or searching through a database, but a "suspend to disk" on an app that's consuming 500MB of RAM could easily take the better part of a minute to "wake up", and even longer to suspend in the first place.

          It would be nice to see the RAM getting more effectively used, but it's quite possibl

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

      No. If you run all of the downloads in parallel then one of them still finishes first and can be used while the others finish off.

      Also, when the available bandwidth per-stream is lower than the available bandwidth per-link it is quicker to run the downloads in parallel. Lastly, when the total bandwidth across all the streams is still less than the link (which is frequently true) then the sequent

    • Thanks for not harping on the "N4 has 2GB RAM" thing. Waiting for one app to finish download first is agonizing if the app is huge (> 100 MB). And then this forces other smaller apps to wait for the large humongous app to finish installing. Even if each download proceeds slower, wouldn't the smaller apps be installed quicker?

  • My poor old Nexus One struggles with memory usage. Every time some app is updated for Android 4 I lose more space (both storage and run-time).

    I only use that phone about 9 days per month, but it is becoming less and less useful as time goes by because of this memory usage issue.

    A few months ago I moved the Dalvik cache onto an Ext3 partition and it helped somewhat. I still have over half of my apps moved to the SD card because everything will not fit.

    Developers, please continue to try to optimize yo

    • Re:On the other side (Score:4, Interesting)

      by tlhIngan ( 30335 ) <slashdot&worf,net> on Tuesday March 26, 2013 @10:36AM (#43281397)

      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).

      • I think that will actually continue with the iOS trend. People that buy iPhones are buying appliances, appliances used mostly for media consumption on the move that also happen to be phones.

        I bought a Samsung Note II because I needed to do work with it, and the stylus and large screen are bloody fantastic for my work.

      • Google claims about 1.3M daily Android activations

        It's possible. While trying out different ROMs for my phone, I've connected it to google like eight times in one day...

    • A few months ago I moved the Dalvik cache onto an Ext3 partition and it helped somewhat. I still have over half of my apps moved to the SD card because everything will not fit.

      That's storage space, not RAM. Your Nexus One may suffer from memory constraints as well, but they'll have nothing to do with the number of applications you store on your SD card, or where you put your Dalvik cache ...

  • by Anonymous Coward on Tuesday March 26, 2013 @10:09AM (#43281077)

    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...

    • I think the main thing you could reasonably do is use the memory as a buffer for the SDCard/Internal storage. This is the one thing that makes Windows 7 so much better than Windows XP. It has much better caching, and your computer actually gets faster as you leave in on for longer, because it has most of the stuff you already need in cache. There's no reason why the Android OS couldn't copy an entire ebook file into memory when an application requested the file be opened. If the memory was needed later, i
      • by blueg3 ( 192743 )

        That's just disk caching. I don't know to what extent Android does it, but most modern operating systems do as much disk caching as they can afford. It's often reported as free RAM, though, because it essentially is.

    • by h4rr4r ( 612664 )

      This is why we have SWAP.

      The OS should just swap the application out to disk and bring it back in when needed. Killing the app should only be done when you are out of SWAP and RAM.

      Modern OS's figured this out long ago, why must we reinvent the computer with new hardware it runs on?

      • Two reasons.

        FIrst, because flash chips have a limited number of write cycles. Repeatedly writing to swap files kills them more rapidly. For sure more recently desktop OSs use swap on SSDs, But they are expensive, and large compared to the flash chips in mobiles. So whilst swap is slowly killing them too, their life expectancy is longer.

        Secondly, desktop OSs have to keep many apps running, because of their multi-window nature, users can see multiple apps. Smartphones are essentially single app UI devices, so

        • Typical minimum is 100,000 write cycles. If each swap uses 1/3 of the flash and you swap 165 times a day, that's a minimum 5 year life.
          • 5 year lifespan. Funny how that's become acceptable.

            And if it's more than 165 times? We've all experienced too many apps on a desktop OS, with the resultant slow down, and the hard disk being thrashed constantly. Hopefully that's mostly reads. But not necessarily.

            And of course the no swap design for smartphones dates back years, to times when wear was more of a problem for flash.

            Oh, and I thought of a 3rd reason. When the smartphone only has a few GB flash, a swap drive would take a big chunk out of it that

            • by h4rr4r ( 612664 )

              No one keeps a smartphone that long.

              1 GB of swap would easily hold all the browser tabs.

              • 1 GB of swap would easily hold all the browser tabs.

                That's not how a swap file works. It works at the level of memory requests. It has no idea of applications, let alone a specific app or purpose for the memory.

                Besides, 1GB of storage can be an enormous amount for a smartphone. The Samsung Galaxy Ace is a still shipping Android smartphone with only 0.5GB of flash storage.
                http://en.wikipedia.org/wiki/Samsung_Galaxy_Ace [wikipedia.org]

                Of course it can get more storage with microSD. Which is far slower, allocated to Application storage, rather than system, and liable to be rem

    • by Zan Lynx ( 87672 )

      Android does have this feature. It is part of ashmem (Android shared memory) which is a patch to the Linux kernel. Under memory pressure the kernel can discard the pages and when the application goes back for them it is notified that they are gone.

    • Isn't this easy to solve -- just make an API in OS for requesting "temp" or "cache" memory. Apps using this memory have to be prepared that it no longer exists -- just like weak references in Java for instance.
  • I recently upgraded from a very old Android(300M of RAM) phone to a Nexus 4 and it amazes me how long it will keep an application at the same point. On my old phone, it recycled memory so quickly that going from an app, to home, and then launching calculator or something and going back to the app, it would be a fresh session. On the Nexus though I've launched an app in the evening with it keeping the same state that it had in the morning when I launched it without reloading anything.

    That being said, YES i

  • cyanogenmod (Score:4, Interesting)

    by admdrew ( 782761 ) on Tuesday March 26, 2013 @10:18AM (#43281175) Homepage

    I run Cyanogenmod [cyanogenmod.org] 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.

  • Comment removed (Score:5, Informative)

    by account_deleted ( 4530225 ) on Tuesday March 26, 2013 @10:30AM (#43281285)
    Comment removed based on user account deletion
    • by godrik ( 1287354 )

      Oh that's good to know. I wish I had mod points. I always thought swiping the app away meant "I am not going to use that, you can unload it" which would be a nicer version of force stop.

      • As far as I can tell, swiping away does exactly that.

      • 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).
  • The problem is that about Froyo, when app2sd functionality was rolled into the OS, onboard memory was EXPENSIVE and SD was cheap, so there was a deliberate design decision to avoid letting non-system apps take over program memory. Even back then, this was a less than acceptable idea, as there were different ROM and RAM totals (okay, onboard storage and program memory, yeah, the're not QUITE ROM/RAM) even then, so a given app could use all RAM when running and still have a very small footprint in ROM, putti

  • by Fnord666 ( 889225 ) on Tuesday March 26, 2013 @10:43AM (#43281499) Journal
    Dear Editors,

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

    Thanks.

    Fnord666

  • I agree with you (and MS) that Free RAM is wasted RAM. Probably upcoming versions of apps will check if they need to swap/release before doing so ?

    As for "When connected to WiFi or 3G/LTE, there's no reason why multiple simultaneous downloads shouldn't be used." Yes there is: whatever is limiting the speed of your download/install (it(s not instantaneous yet, is it) will also impact simultaneous downloads. Plus thrashing.

  • If is specifically about android and dalvik apps you won't have available all hardware power for your app. I would go to native apps either in Android or some other linux based OS for that kind of things, and of course, native apps for those OSs (development could be done in QT/QML for most of them, porting between them should not be so hard)
  • In the mentioned situations I believe it's mostly the OS that's to blame, more so than the app.

    If I were to develop an e-reader app, that reads a book from a file on disk, I would just open the file, and start reading the needed parts from it. Most modern OSes will then cache the file in RAM, or at least start reading ahead as much as possible, after all if the first bytes of a file are read, it's likely the following bytes will be read in the near future, and if not this memory can easily enough be overwri

  • ... you have to set your dilithium chambers to "maximum".

    [ My vote for dumbest line in the last Star Trek movie. ]

  • Could we just give the OP the benefit of the doubt that he simply just misspoke? It seems like he has a legitimate question, and instead the discussion is getting lost in a bunch of crap posts all saying the same thing about the 16GB. Jeebus, people.

  • Maybe this is the right place to ask this question:

    Is there any way to force Chrome on my Galaxy Nexus to either fully cache the current page so it can display it instantly upon browser startup, or to not reload it when I start the browser and show me a blank screen?

    It's annoying to start up the browser when I last was viewing a large, complicated page, and then I have to wait while the browser tries to reload and display that page, even though I want to go to a new page. Even if I hit the stop button, I h

  • Is not much of what the OP complaining about an attempt to preserve the phones battery life?

  • On those Android phones which have user SD card slots, I wouldn't mind allowing the phone to page memory to the card at all if it saves on bandwidth. For internal flash... definitely not.

    I already cycle about a gigabyte a day through my 16G microSD card just from DogCatcher. Another few hundred megabytes wouldn't make a dent and those cards are pretty cheap anyway.

    However, allowing paging on any machine can lead to big trouble in the form of thrashing. It probably isn't reasonable to implement that sort

  • by spire3661 ( 1038968 ) on Tuesday March 26, 2013 @03:11PM (#43284701) Journal
    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.

You know you've landed gear-up when it takes full power to taxi.

Working...