Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

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

timothy posted about a year and a half ago | from the never-satisfied dept.

Android 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?"

Sorry! There are no comments related to the filter you selected.

Happy Tuesday from The Golden Girls! (-1)

Anonymous Coward | about a year and a half ago | (#43280983)

Thank you for being a friend
Traveled down the road and back again
Your heart is true, you're a pal and a cosmonaut.

And if you threw a party
Invited everyone you knew
You would see the biggest gift would be from me
And the card attached would say, thank you for being a friend.

Confidant! Not Cosmonaut You Stupid Git! (-1)

Anonymous Coward | about a year and a half ago | (#43281085)

Your heart is true, you're a pal and a cosmonaut.

Jesus Christ, I can't stand it any longer. The lyric is "Your heart is true, you're a pal and a confidant." Seriously confidant, confidant, confidant, confidant, confidant, confidant, get it through your thick trollish skull if you're going to troll us, at least get the goddamn lyrics correct!!! My god, it doesn't even sound the same [youtube.com] , you worthless moron!

Oh and Betty's next.

Re:Confidant! Not Cosmonaut You Stupid Git! (2)

geminidomino (614729) | about a year and a half ago | (#43281205)

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.

Re:Confidant! Not Cosmonaut You Stupid Git! (1)

SternisheFan (2529412) | about a year and a half ago | (#43281433)

It's like that line from Elton John's song "Tiny Dancer".

"Hold me closer, Tony Danza..."

- - -

There's a bathroom on the right.

That phone has 2GB of RAM (5, Informative)

Anonymous Coward | about a year and a half ago | (#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:That phone has 2GB of RAM (3, Interesting)

adycarter (261257) | about a year and a half ago | (#43281031)

exactly what I was just about to say.

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

It has 2gb of Ram

Re:That phone has 2GB of RAM (1)

adycarter (261257) | about a year and a half ago | (#43281049)

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

Re:That phone has 2GB of RAM (4, Interesting)

jeffmeden (135043) | about a year and a half ago | (#43281159)

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

I have better than 4G: I have Wi-Fi. (1)

tepples (727027) | about a year and a half ago | (#43281295)

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.

Re:I have better than 4G: I have Wi-Fi. (1)

jeffmeden (135043) | about a year and a half ago | (#43282205)

You have 50 megabit wired service? That's good, but most people don't have anywhere near that for their home/office, but can get it through 4G. That's what I was suggesting, since to save any time you basically need to saturate the google server sending you the app but not saturate the internet uplink, which is pretty damn hard to do.

Re:I have better than 4G: I have Wi-Fi. (1)

hawguy (1600213) | about a year and a half ago | (#43282293)

You have 50 megabit wired service? That's good, but most people don't have anywhere near that for their home/office, but can get it through 4G. That's what I was suggesting, since to save any time you basically need to saturate the google server sending you the app but not saturate the internet uplink, which is pretty damn hard to do.

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?

Re:I have better than 4G: I have Wi-Fi. (2)

jeffmeden (135043) | about a year and a half ago | (#43282417)

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.

Re:That phone has 2GB of RAM (1)

Anonymous Coward | about a year and a half ago | (#43281337)

Unless the device is hooked up to a high current USB port (I'm referring to a 2A+ port) then there's a very real possibility that you'll actually end up discharging the battery. It's not difficult to have a phone draw more than the capacity of a USB port (the official spec limits power usage to 500mA/port).

I remember when you put the Google/HTC G1 in wifi hotspot mode it would drain the battery, even when plugged in. Tablets and cellphones are optimized for power efficiency, but can easily burn through juice given the opportunity.

There is also the problem of heat dissipation. I'm sure manufacturers pay attention to thermal requirements when they're designing them, but the fact of the matter is since it's a mobile device, they're not going to optimize the thermal profile to account for 100% utilization for hours on end.

Your desktop idling, with the CPU governor set to 'conservative,' even with an IGP, would probably skate circles around an ARM device.

Re:That phone has 2GB of RAM (1)

rjr162 (69736) | about a year and a half ago | (#43282093)

If I use the 1.5A Samsung charger, or the 1.5A universal cigarette plug lighter, it holds well even under heavy load.

Now if I use say the iPad 2 USB adapter, even under modest load it will either just barely charge or slightly discharge.. 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 why do you think that is (2)

SuperKendall (25149) | about a year and a half ago | (#43282251)

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.

Re:That phone has 2GB of RAM (1)

jeffmeden (135043) | about a year and a half ago | (#43282279)

It's not difficult to have a phone draw more than the capacity of a USB port (the official spec limits power usage to 500mA/port).

I remember when you put the Google/HTC G1 in wifi hotspot mode it would drain the battery, even when plugged in.

Most phones ship now with a 1000mA charger, which is enough to just about top out the CPU (the HTC G1 days are LONG gone). I suggested a safeguard anyway, that is to make sure the phone is done charging before starting an app like that. If the phone has to go back into charging mode (if it is outstripping the current limit on the charger) then the (currently just hypothetical) app will pause again while the battery charges. Same goes for heat, current phones all have temperature sensors to monitor for battery runaway, that could be used to keep the temperature at a reasonable level.

Your desktop idling, with the CPU governor set to 'conservative,' even with an IGP, would probably skate circles around an ARM device.

My desktop idling will still consume more than 10W, and no it won't outperform my phone (my phone is a lot newer than my desktop, I suspect the same goes for a lot of people).

Re:That phone has 2GB of RAM (0)

Anonymous Coward | about a year and a half ago | (#43281177)

So is there something preventing an app from storing user data in the internal storage memory?

My three year old Droid 1 has a 16GB flash card. It would be nice if it would store hidden browser tabs there instead of forcing a reload if I go more than 2 links deep.

Re:That phone has 2GB of RAM (0)

Anonymous Coward | about a year and a half ago | (#43281827)

The fastest SD cards on the market can't write much faster than 20MB/sec, whereas the RAM on a Nexus 4 is something like 12GB/sec. Using an SD card for swap would be painful.

Re:That phone has 2GB of RAM (0)

Anonymous Coward | about a year and a half ago | (#43282067)

That would not be memory swapping, but browser caching. Still, caching in available RAM instead of to the slower storage medium would be faster.

Re:That phone has 2GB of RAM (2)

interkin3tic (1469267) | about a year and a half ago | (#43281151)

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.

Re:That phone has 2GB of RAM (0)

Anonymous Coward | about a year and a half ago | (#43281271)

As another poster already pointed out, there is no need to mention the storage capacity. Both the 16GB and 32GB versions of the tablet have 2GB of RAM inside.

Based on your assessment comment (of the RAM screen showing 1GB of 2GB used, vs internal storage screen showing ??GB of 16GB used), it is even more so that the OP is confused between RAM and storage capacity. This is consistent with computer illiterate people who thinks the RAM and hard disk inside the computer are one and the same thing, or to interchange terminology when referring to the other.

Summary a bit confusing... (3, Insightful)

bondsbw (888959) | about a year and a half ago | (#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.

Re:Summary a bit confusing... (0)

Anonymous Coward | about a year and a half ago | (#43281951)

Indeed and then I was all WTF would a hand held need 16GB of RAM. I mean, a desktop does just fine with 4GB or even less.

It's Probably Up to the OS to Manage Resources (1)

Anonymous Coward | about a year and a half ago | (#43281039)

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.

Re:It's Probably Up to the OS to Manage Resources (1)

h4rr4r (612664) | about a year and a half ago | (#43281267)

It does it poorly.

Android far too aggressively swaps apps out. It made sense when phones had 256MB of ram, it does not today.

Re:It's Probably Up to the OS to Manage Resources (2)

TheRaven64 (641858) | about a year and a half ago | (#43281481)

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.

Re:It's Probably Up to the OS to Manage Resources (1)

sarysa (1089739) | about a year and a half ago | (#43281667)

The os will do simple things like kill processes, but it is up to the software and most software is written conservatively so it can handle the crap devices. Low app prices means optimizations like OP is describing is not worth the effort.

Wrong (2)

egcagrac0 (1410377) | about a year and a half ago | (#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.

Re:Wrong (1)

grantspassalan (2531078) | about a year and a half ago | (#43281315)

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 my laptop to sleep if I was not going to use it for a few hours, but now with the SSD it boots so fast, I simply shut it down and then reboot when I need it again. I think this article is splitting hairs.

Re:Wrong (1)

h4rr4r (612664) | about a year and a half ago | (#43281367)

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.

Re:Wrong (0)

Anonymous Coward | about a year and a half ago | (#43281715)

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.

If it's a garbage app, yes. If it's made RIGHT, Android tells the app that it's going to be stopped and gives it a last chance to save its state (or as much as is needed to recreate its state) to persistent storage before killing it. This is on a per-app basis, too; the app defines what it needs to do in such a situation. There's even callbacks the OS can call if RAM is running low so the app can try freeing up caches before Android makes the call to start killing.

Of course, in some cases, like web browsers, saving the entire state of every page in every tab could suck down the 8-16GB of persistent storage a Nexus 4 has, especially when you're talking about large, complicated webpages, pages with active JavaScript whose states become useless when frozen and serialized, stale pages whose information is misleading or invalid if not reloaded anyway, or the derpshits with a pathological need to keep eighty thousand tabs open at all times lest they start getting nervous shakes. So, in the absence of the potential for 16+GB of readily-accessible RAM, hundreds of gigs of swap space, and the presence of other apps and media that might want to use persistent storage for something other than holding onto an old, possibly useless webpage the user simply forgot they had in their bloated tab list, the web browser will play it safe and only stash away the current URLs and histories of each tab if it needs to be killed off.

So really, the problem is that, no matter what everyone's trying to tell you, phones and tablets are NOT full-on desktop PCs or laptops, and they in fact have a LOT more limitations than either. If you stop thinking that you're holding a portable desktop, the thing works a LOT better.

Re:Wrong (1)

h4rr4r (612664) | about a year and a half ago | (#43281777)

Then every android browser is a crap application.

All of them reload the page if they happen to get killed off.

The solution is to give me 128GB+ of storage and let me treat it like a full PC. That is what I want.

Sounds like you need (-1)

Anonymous Coward | about a year and a half ago | (#43282231)

IOS

Re:Wrong (1)

Tokerat (150341) | about a year and a half ago | (#43282395)

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, the solution is to run full tilt when on charger+WiFi, and leave the optimizations for when they're actually needed. The only difficulty I see with that scheme is end-user confusion and frustration ("it works from home but it's terrible when I am on the move. Must be my carrier's fault!") - might be worth it if it could somehow be effectively communicated to the users; and by user, I mean anyone, not just the tech savy.

Re:Wrong (1)

egcagrac0 (1410377) | about a year and a half ago | (#43281449)

It's a less noticeable impact, but FLASH is still slower than RAM.

Re:Wrong (0)

Anonymous Coward | about a year and a half ago | (#43282393)

Yes, because swapping an app out to Flash means you have to write to the Flash, which reduces its lifespan. It's more practical to kill the process and later reload the app, which is a read-only operation and doesn't age the Flash chip.

Re:Wrong (0)

Anonymous Coward | about a year and a half ago | (#43282337)

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

Sometimes the bandwidth is limited by the server not the client. If downloading from different servers it makes sense to do both at once.

Read up on ARM (0, Insightful)

Anonymous Coward | about a year and a half ago | (#43281045)

This is a platform that was not designed to have a scheduler carving up resources. If you want a mobile device that makes good use of the available resources (and somehow manages to try to conserve power while doing it) ARM isin't where you're looking. (ARM in clusters: awesome idea. great power efficiency at performing simple SINGLE tasks while other units perform simultaneous threads.)

And re, cell network: There's physical problems with trying to maintain high data rate, low latency, long range connections (especially at low power) It's a miracle it works at all in most cases. :P

Re:Read up on ARM (2)

serviscope_minor (664417) | about a year and a half ago | (#43281287)

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.

Re:Read up on ARM (4, Informative)

TheRaven64 (641858) | about a year and a half ago | (#43281653)

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.

On the other side (1)

laing (303349) | about a year and a half ago | (#43281065)

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 your applications for older phones.

Thank you.

Re:On the other side (0)

Anonymous Coward | about a year and a half ago | (#43281167)

As the owner of an old Motorola Cliq, i second that. I've managed to get it to run Android 2.3 via Cyanogenmod, but memory usage for apps such as Whatsapp is painful.

Re:On the other side (3, Interesting)

tlhIngan (30335) | about a year and a half ago | (#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).

Re:On the other side (1)

Ironhandx (1762146) | about a year and a half ago | (#43281721)

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.

Re:On the other side (1)

drinkypoo (153816) | about a year and a half ago | (#43281927)

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

Re:On the other side (0)

Dishwasha (125561) | about a year and a half ago | (#43281479)

I that same vein, Android please stop removing my shortcut icons on the desktop every time an app updates. I put those shortcuts there so I wouldn't have to find them again and it is very annoying.

Re:On the other side (0)

Anonymous Coward | about a year and a half ago | (#43282349)

People with much older phones don't purchase newer software. Optimization is not actually a benefit to them.

The problem with ram (4, Insightful)

Anonymous Coward | about a year and a half ago | (#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...

Re:The problem with ram (1)

DoubleParadoxx (928992) | about a year and a half ago | (#43281201)

Windows Mobile 6 had exactly this ability. Do Android and iOS seriously not have this crucial feature?

Re:The problem with ram (2)

michelcolman (1208008) | about a year and a half ago | (#43282263)

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.

Re:The problem with ram (1)

CastrTroy (595695) | about a year and a half ago | (#43281217)

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, it could take back the memory, and then re-open the file next time the ereader applications requests for the file to be read. Perhaps things like music players could make calls to the OS to put things into memory so that they would likely be in cache by the time they actually needed them. They could let the OS know what the next file was in the queue so that it would be in memory assuming there was some available.

Re:The problem with ram (1)

blueg3 (192743) | about a year and a half ago | (#43281369)

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.

Re:The problem with ram (0)

Anonymous Coward | about a year and a half ago | (#43281431)

Maybe I'm ignorant, but doesn't the Linux kernel already do RAM caching, and has been doing so since '91? So, if a file is read multiple times, it will remain in memory until some other task pushes it out.

Re:The problem with ram (1)

h4rr4r (612664) | about a year and a half ago | (#43281331)

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?

Re:The problem with ram (0)

Anonymous Coward | about a year and a half ago | (#43282437)

The problem with SWAP is that it writes to Flash, which has a finite number of write cycles, but a near-infinite number of read cycles. It's better to kill the app and just write a portion of its state out to Flash, which reduces the amount of writes and leverages Flash's near-limitless reads.

Re:The problem with ram (1)

Zan Lynx (87672) | about a year and a half ago | (#43281505)

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.

Re:The problem with ram (2)

digitalvengeance (722523) | about a year and a half ago | (#43281599)

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() [android.com]

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.

Re:The problem with ram (0)

Anonymous Coward | about a year and a half ago | (#43281629)

Huh? iOS is set up to do exactly what you says it can't: If memory gets tight, it asks apps to give back memory for things that it doesn't need right now or can easily recreate. Now, this takes actual work from a developer and isn't automated in malloc/free, but that's perfectly reasonable.

Android really doesn't do anything similar?

Re:The problem with ram (0)

Anonymous Coward | about a year and a half ago | (#43281757)

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

Activity.onLowMemory() [android.com]

Since Android API version 1. You're welcome.

Re:The problem with ram (1)

Andreas Mayer (1486091) | about a year and a half ago | (#43281879)

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

Yes, there is. At least in iOS the system will send messages to the app to tell it to "please free up some memory". Of course, if it doesn't it may still be terminated.

Nexus 4 is 2GB of RAM, not 16GB (0)

EmagGeek (574360) | about a year and a half ago | (#43281087)

Just so yo know...

fucK3r (-1)

Anonymous Coward | about a year and a half ago | (#43281095)

backward and said another troubled LONG TERM SURVIVAL THERE ARE SOME with the number used to. SHIT ON disgust, or been Have somebody just errors. Future I IT'S BEST TO TRY if I remain Usenet is roughly it will be among over to yet another and financial kill myself like is busy infighting clear she couldn't where it was when serves to reinforce everyday...We users. BSD/OS bunch of gay negros my bedpost up my noises out of the way. It used to be who are intersted confirming the paranoid conspiracy and exciting; It's best to try fly...don't fear GNAA (GAY NIGGER A BSD over other that FrreBSD is new faces and many Abysmal sales and exactly what you've to decline for FreeBSD core team our ability to FreeBSD had long To have to decide spot when done For

What a stupid question (0)

Goodl (518602) | about a year and a half ago | (#43281117)

two minutes googling would tell you that the available RAM is only 2GB, what is this newbie crucifiction week?

Re:What a stupid question (1)

synapse7 (1075571) | about a year and a half ago | (#43281183)

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.

Re:What a stupid question (1)

p00kiethebear (569781) | about a year and a half ago | (#43281265)

Hey, we were all young and dumb once. But not me. I was never dumb. This question at least is better than the 'I'm so new to linux and stuff and I have lots of time to spend on learning even if I have to dedicate months of time!'

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.

Re:What a stupid question (1)

Goodl (518602) | about a year and a half ago | (#43281353)

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.

Re:What a stupid question (1)

gstoddart (321705) | about a year and a half ago | (#43281441)

two minutes googling would tell you that the available RAM is only 2GB, what is this newbie crucifiction week?

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.

I'm pretty sure "it does" (1)

earlzdotnet (2788729) | about a year and a half ago | (#43281123)

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)

Re:I'm pretty sure "it does" (0)

Anonymous Coward | about a year and a half ago | (#43281393)

This must be something specific to the Nexus 4 build. Using the stock android browser (yes, the one everyone proclaims is such a huge stinking pile of manure) I can download files simultaneously. I'm running AOKP 4.2.2 on my HTC phone.

Development Issue (0)

Anonymous Coward | about a year and a half ago | (#43281131)

This is a developer's issue here. The optimizations you talk about take a long time to implement and how would you determine these types of things on the fly? 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. So I could basically open every app on my phone simultaneously and still have a bunch of that 1 GB memory left. As for multiple downloads, you could download two at 50kb/s or one at 100kb/s. Does it really even matter?

Open several pages in tabs to read later (1)

tepples (727027) | about a year and a half ago | (#43281261)

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.

Re:Open several pages in tabs to read later (0)

Anonymous Coward | about a year and a half ago | (#43281799)

"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 an app [google.com] for that.

Re:Open several pages in tabs to read later (1)

Jmc23 (2353706) | about a year and a half ago | (#43282039)

menu->save page

cyanogenmod (3, Interesting)

admdrew (782761) | about a year and a half ago | (#43281175)

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.

Re:cyanogenmod (1)

Tiger_Storms (769548) | about a year and a half ago | (#43281615)

There is an option under developers to tell it to cache 1-5 apps or for it to simply kill any background running processes in CyanogenMod. The biggest reason they all do this is to save on power. Yes you might have an awesome battery life but you don't want to wake your phone up 2-3 hours later after it's still running all of your apps the whole time and have a dead battery.

Program for LCD (0)

Anonymous Coward | about a year and a half ago | (#43281203)

You suffer from a common issue, but simply put programmers tend to make apps for the lowest common denominator and its easier to operate under the assumption that a users device has limited resources for most apps than to manage RAM proactively.

Ferrari (0)

Anonymous Coward | about a year and a half ago | (#43281209)

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?

Re:Ferrari (5, Funny)

Chrisq (894406) | about a year and a half ago | (#43281257)

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

Re:Ferrari (1)

chill (34294) | about a year and a half ago | (#43281347)

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.

Re:Ferrari (2)

Nidi62 (1525137) | about a year and a half ago | (#43282303)

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.

Re:Ferrari (0)

Anonymous Coward | about a year and a half ago | (#43282327)

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.

I'll fuck you if I get to ride in your car. ... 28 fat blond male babe

Re:Ferrari (0)

Anonymous Coward | about a year and a half ago | (#43281381)

Do yourself and everybody else a favour: Take your Ferrari to the track.

Re:Ferrari (0)

Anonymous Coward | about a year and a half ago | (#43281455)

Your Ferrari performs its primary function (looking cool) perfectly well. On those occasions when you actually need to utilise a high degree of sports car performance, such as when you take the car to a track day, you will be happy to find that the car is capable of delivering it. The rest of the time, it is true that you will not be pushing the car's capabilities, however this means that you will be maintaining a more practical level of fuel efficiency, and reducing heat stress on the engine, so it will last longer.

Go away... (0)

Anonymous Coward | about a year and a half ago | (#43281263)

Seriously.

Force stopping 'Running Apps' from 'Switch Apps' (5, Informative)

SternisheFan (2529412) | about a year and a half ago | (#43281285)

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

Re:Force stopping 'Running Apps' from 'Switch Apps (1)

godrik (1287354) | about a year and a half ago | (#43281821)

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.

Re:Force stopping 'Running Apps' from 'Switch Apps (0)

Anonymous Coward | about a year and a half ago | (#43281913)

What does this have to do with anything at all?

hysterical raisins (1)

waddgodd (34934) | about a year and a half ago | (#43281401)

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)

Not all RAM is available (0)

Anonymous Coward | about a year and a half ago | (#43281419)

An Android device may have 2GB of RAM, but each app is only given something like 24MB to 48MB dependent upon the device manufacturer. That is why it is so easy for a particular app to run out of memory if the developer doesn't manage allocation well.

Ask Slashdot? (2)

Fnord666 (889225) | about a year and a half ago | (#43281499)

Dear Editors,

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

Thanks.

Fnord666

Coding getting worse (0)

Anonymous Coward | about a year and a half ago | (#43281549)

I've been a programmer for a long time, and one thing that has always bothered me is the amount of crap programs put in memory. Years ago, it was a general rule to put only what was needed in memory, and write your code as efficiently as possible to increase the performance and allow your program to work on larger data sets than might normally be possible with the memory limitations at the time. Then computers got faster and had more memory available, and the old programming logic was thrown out the window and programs became too bulky and loaded with extra crap that eats up too many resources. I have checked the memory footprint of multiple programs on windows and have found that one of my chat programs uses roughly 10MB of memory while it is running, and another one uses roughly 130MB. The 130MB program is prone to crashing, is much much slower, and doesn't really offer any benefits over the program with the 10MB footprint.

So using more memory shouldn't be a measure of how well a program works, and I would argue the opposite in most cases! The 16GB of internal storage in the phone should be more than fast enough to read the data the user will be interacting with. Provided the program code is efficient and uses very little memory (which is should), accessing the data to display on the screen should be nearly instantaneous. If the ebook reader is that inefficient, don't blame the OS from trying to protect itself and other apps from garbage coding.

I bet if your ebook reader was written in assembler it would use barely a fraction of the memory it currently uses, and would be lightening fast. In that case though, it would also probably look like crap, would take a very long time to code, and an even longer time to fix bugs when/if they show up.

Who's the tool? (1)

Anonymous Coward | about a year and a half ago | (#43281611)

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.

Are you sure ? (1)

obarthelemy (160321) | about a year and a half ago | (#43281637)

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.

It's slow. (1)

Impy the Impiuos Imp (442658) | about a year and a half ago | (#43281747)

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.

What about OS for those apps (1)

gmuslera (3436) | about a year and a half ago | (#43281843)

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)

Not the app, the OS is to blame (1)

wvmarle (1070040) | about a year and a half ago | (#43281981)

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.

To get "full power"... (1)

fahrbot-bot (874524) | about a year and a half ago | (#43282167)

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

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

Cripe (1)

darjen (879890) | about a year and a half ago | (#43282243)

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.

Memory cap (0)

Anonymous Coward | about a year and a half ago | (#43282383)

The Dalvik Virtual Machine has a heap memory limit (dependent on various things) well below the maximum memory for your phone - one example of this problem is here: http://tordtech.blogspot.ca/2009/09/memory-limit-on-android.html

This article also contains a solution for your problem. I haven't tested it myself, so I'm really sorry if you brick your phone. If you don't know C++, try this:

1. Learn C++
2. Reread article.

All in all, I would rather live with the inconvenience than go to the trouble of recompiling Android, but if you really care, there you have it.

Chrome Android caching/reload (1)

hawguy (1600213) | about a year and a half ago | (#43282391)

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.

Load More Comments
Slashdot Login

Need an Account?

Forgot your password?