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?"
The 16GB Nexus 4 doesn't have 16GB of RAM. It has 2GB. Your post reads like you think it has 16GB of RAM.
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.
You are running a device capable of running many simultaneous tasks, you can't have all of them decide to use every bit of RAM or disk space. It's up to the OS to maximize resource allocation and minimize battery usage.
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.
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 your applications for older phones.
Thank you.
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 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 it is extremely annoying that it only downloads 1 thing at a time, despite clearly being capable of downloading many things at once. (oddly enough this rule is kept in place when downloading with Chrome as well)
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.
LegendMUD
Also, this is only an issue for the Nexus or custom roms, and what a problem to have, too much excess free ram! Phones running roms with carrier BS more "fully utilize" the phones ram.
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.
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?".
Minimizing ram usage is the regular method for programs. I don't know which programs you are using, but most of my phone's apps are 50mb or less.
I want to open a bunch of web pages in tabs while connected to Wi-Fi, hit the road, and then being able to display each page without having the device purge the page from the cache and try to reload it from a data connection that doesn't exist. There's no Wi-Fi on city buses. One reason I carry a 10" laptop instead of a tablet is because web browsers designed for laptop operating systems are historically better at this use case.
As for multiple downloads, you could download two at 50kb/s or one at 100kb/s. Does it really even matter?
It does when the one download is failing to saturate your downstream because the server is limiting one to 50kb/s.
He at least is asking a valid question about memory usage on cell phones. I had never really thought about memory allocation as a method of limiting power consumption for my phone before because I always have a laptop with me to plug in to. Learn something new every day.
The Blade Itself
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. :-)
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.
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).
When I'm downloading a bunch of applications to my tablet, I have better than 4G: I have Wi-Fi with a wired upstream.
Technically that'll be getting the most IN the car, not necessarily out of it -- especially if you have a shitty apartment. Blonde or not, they'll see thru the ruse.
Learning HOW to think is more important than learning WHAT to think.
I didnt mean any disrespect to the OP, I just meant he or she is being tossed to the lions asking a question that was very easily answered with a little googling.
I've got some photographs, I'd like to show them to you. Though you don't know the girls You'll recognise the view..
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, putting all its storage on SD. Even now, with your 16 GB nexus that has 2 GB program memory, you see that issue, albeit not so much. Once upon a time, it used to be said that you had three things that could be traded for each other, storage, memory, and processor, and that still applies today. I just think Android is making a very bad choice in what to trade. The real thing that would help this issue is if someone went through all the android appstores and took a damn optimizing compiler to everything, if you look at what should be computationally easy things, they invariably want entirely too many resources for that they really do. It really wouldn't surprise me to see a "shopping list sorter" that took up 2GB of storage, for example (even a bogosort shouldn't take THAT much resource)
Just because you're paranoid doesn't mean they aren't out to get you
"Hold me closer, Tony Danza..."
- - -
There's a bathroom on the right.
Or "ramifications of bad marketing week" -- because I wouldn't be surprised if those companies are advertising it as having 16GB of memory and not differentiating between 'storage' and 'RAM'.
A phone with 16GB of RAM would be kinda crazy just yet.
Lost at C:>. Found at C.
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
That even let this post through?
16GB of RAM? Who seriously thought that that phone had 16GB of RAM? My fucking developer workstation doesn't even have 16GB of RAM!
Sheesh.
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.
The Cloud - because you don't care if your apps and data are up in the air.
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:
In summary, the orifice that you are talking out of is not your mouth.
I am TheRaven on Soylent News
I have 384 MB of RAM on my Droid Charge. Task Manager reports 368 total, so some has disappeared.
Of that 368, 236 is taken up by the OS and Verizon bloatware which, if I kill it, gets restarted.
I don't need 30 things sucking up 5 meg each.
(-1: Post disagrees with my already-settled worldview) is not a valid mod option.
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.
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 overwritten by something else again. An app shouldn't even try to do this - it shouldn't try to fill up the memory - let the OS take care of that part. Resource management is an OS task, not a userland task.
An app should try to minimise direct resource use, that will generally speed up things overall. For example reading the whole e-book from disk and storing it in RAM will cause the process to grow big, and more likely to be killed to make space for other processes, so a next startup takes much longer. It growing so big also means more other processes have to get killed when the reader app is used, just to make space.
And yes I use "disk" here knowing full well that in a phone that's usually some kind of flash memory or SD card or whatever.
[ My vote for dumbest line in the last Star Trek movie. ]
It must have been something you assimilated. . . .
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.
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
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
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 have to wait for the browser to finish up what it's doing before it will stop.
It's not that I'm memory constrained, even if I reboot the phone to get most apps out of memory, open the browser and go to a page, go back to the home screen, then back to the browser, the browser downloads and redisplays the current page.
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.
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!
As far as I can tell, swiping away does exactly that.
We hope your rules and wisdom choke you / Now we are one in everlasting peace
Is not much of what the OP complaining about an attempt to preserve the phones battery life?
I am very small, utmostly microscopic.
Bad example. That's actually what Freddie sang.
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).
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 of feature as a default on a consumer phone.
At least in the case of browsers the default memory limits can clearly be increased.
-Matt
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
no, the B10 with the physical keyboard is the superior product.
i dunno about iphone but this problem is extremely apparent on the 4g ipad. load up a couple of tabs, go to the music player, go back to safari. reload all webpages.
Wealth is the gift that keeps on giving.