[Q] Deviding memory - Android Software/Hacking General [Developers Only]

Hi all
I just noticed that my x6d was going slow, so I checked my task manager and found out that I had 13 MB remaining for my normal apps and over 60 for my services.
Is there any way where I can 'steal' memory from the services and give it to the normal running applications ?
With normal apps I mean the programs that I manually start, such as market, browser, games and stuff like that.
Thanks

Related

[Q] RAM observations

I have my Nexus S for over two weeks now, and I'm incredibly happy with it. Theming is a lot of fun, and you can do very cool stuff even without root and custom roms!
However, there is one (strange) thing I've noticed. It's about the RAM.
For your information: I use Go Launcher which has a tab in the App Drawer with running applications, and a button to close all (you can exclude certain apps). When I boot up my phone, I have 170-180 MB free RAM. The following programs (and widgets) are running in the background (I have excluded them from the close all list): Go SMS Pro (widget, notifications), WhatsApp (notifications), Lookout, Extended Controls (widget), Wiget Locker (I made it look like the MIUI lockscreen) and Clockr (widget).
There are two more apps that are on constantly, and those are the Miren Browser and PlayerPro. I don't know why Miren Browser keeps turning itself on. When I check how much MB it uses, it says 0,00 dB... As for PlayerPro, I use a widget called Phantom Music Control, a widget that hides itself when no music is being played. I also use it on my lockscreen. This widget controls PlayerPro, so that is probably why PlayerPro has to be running all the time (so that it can start up quickly when needed).
There are some Google apps that turn themselves on, like Gmail and Places, and they actually use RAM according to Go Launcher. I don't want them to be running, and synchronization is turned off with Gmail. When I want to know if I have mail, I open Gmail. It doesn't have to be running all the time. I've never used Places, and I never will use it, so I don't know why that has to be running all the time.
Every once in a while I hit Close All (with Go Launcher). However, I've noticed that over time my free memory keeps lowering. When I boot up my phone it is around 175 MB, but at the end of the day the free memory is 100 MB, 70 MB or even 50 MB, and yes, even after I've hit the 'Close All' button.
I know I don't use my phone very efficient, with programs like Go SMS, Widget Locker and that Music Control widget, and I will flash a custom rom later. My RAM memory will probably increase then (I've read something about Supercurio's kernel including a boost RAM management). It just bothers me that I don't have control over what programs are running (Gmail and Places), and that my free memory decreases over time. I haven't noticed any slow downs, I'm just worried. Or shouldn't I?
I don't know about the rest, but you shouldn't be concerned about free memory.
Android is designed in a way that all programs keep running (sleeping actually) in the background even when you don't use them at the moment. They are automatically killed when the system needs memory for something else. Any program that is sent to the background (e.g. by pressing back or home) can be killed by the system at any time and is (should be) ready for it.
Basically, the less free memory you have, the better. That means that many of the apps you use are running and you can return to them without delay.
There are some articles floating around the web about the architecture of android and process/application life cycle. They explain that better then me, and in more detail.
cgi said:
I don't know about the rest, but you shouldn't be concerned about free memory.
Android is designed in a way that all programs keep running (sleeping actually) in the background even when you don't use them at the moment. They are automatically killed when the system needs memory for something else. Any program that is sent to the background (e.g. by pressing back or home) can be killed by the system at any time and is (should be) ready for it.
Basically, the less free memory you have, the better. That means that many of the apps you use are running and you can return to them without delay.
There are some articles floating around the web about the architecture of android and process/application life cycle. They explain that better then me, and in more detail.
Click to expand...
Click to collapse
First of all, thanks!
So I don't have to be afraid of any slow down? And what about Gmail and Places turning themselves on every time, even if I don't use them?
And why does the free memory decrease over time, but increases again when I turn off and boot up my phone?
Androyed said:
So I don't have to be afraid of any slow down? And what about Gmail and Places turning themselves on every time, even if I don't use them?
Click to expand...
Click to collapse
More like the opposite: your RAM is being put to good use.
When your PC get's low on RAM it will start swapping and trashing around. Your smartphone has no swap and is optimized for it. If it get's low on RAM, it will just kill some stuff in the background. All this happens without you noticing anything (if the app is programmed correctly).
I don't know about Gmail and Places. Most likely they are running because they registered broadcast receivers or something.
Androyed said:
And why does the free memory decrease over time, but increases again when I turn off and boot up my phone?
Click to expand...
Click to collapse
Every app is running in its own dalvik virtual machine process. Since creating a new VM process is expensive (in terms of processing time), the VM processes are reused to some degree. One app is unloaded, the new one is loaded.
There is more stuff going on behind the scenes, of course. There are likely some spare VMs sleeping in the background waiting for an app to use them.
However, the heap (dynamically allocated memory of a process) of a VM can only grow and never shrink (don't ask me why). So after a few apps or so a VM process is restarted, too.
To come back to your question: When your device boots up, only the processes needed for boot are running. That will be the launcher, some widgets and so on. So basically, this is the moment with the most free RAM. However, this is also when your device is slowest, because every new app you launch has first to be loaded into memory and executed.
While you use your device, many of the apps you used will be kept around in the background, so when you start them again, they will reappear instantly, because the whole "create vm process --> load app from storage --> execute and initialize app" chain has already happened.
"Free memory is wasted memory."
When you open an app, the system loads it into ram. When you close it, the system should not bother to remove it from ram because there is a good chance you will use that app again and having it pre-loaded makes it open significantly faster.
Just because ram is "used" doesn't mean it can't be re-allocated for something more important.
That being said, it is entirely possible that some of your apps have memory leaks. Does it get worse after two days, or three days?
d-h said:
"Free memory is wasted memory."
When you open an app, the system loads it into ram. When you close it, the system should not bother to remove it from ram because there is a good chance you will use that app again and having it pre-loaded makes it open significantly faster.
Just because ram is "used" doesn't mean it can't be re-allocated for something more important.
That being said, it is entirely possible that some of your apps have memory leaks. Does it get worse after two days, or three days?
Click to expand...
Click to collapse
I turn my phone off every evening, so I don't know. It's not a problem by any means, I'm just curious.
I've left my RAM alone today, and I didn't noticed any slow down. It was on 110 MB free RAM when I left it alone, and when it was at 35 MB RAM, I decided to hit the close all button (there was no slow down btw). Guess what? My RAM went back up to 140 MB! Not as much as when I boot my phone up, but it's still strange: when I hit close all when the free RAM is very low, I get more free RAM then when I hit close all when my free RAM is around 100 MB (I only get 5 or 10 MB free RAM extra then).
Thanks by the way, good first post!

[Q] strange ram available

Hello everyone
i have noticed something strange about the RAM available, if I go into settings-applications-services running: ram, 211 MB used 80MB free.
If you instead use Android system info I see: 37 MB free RAM
Why this? I have 2.3.4 stock
sorry my bad engish
try terminating cached programs. also, remove unnecessary apps. dont use task killers/managers etc. they are unnecessary. linux is smarter than us. dont use security services unless you frequently visit suspect sites and dl apps w/out research. see which programs are consuming ram and search for solutions. last resort, hard reset. if it persists or low ram issues arise when stock, time for a new one. good luck.
The nexus S has 345MB for the OS and apps, rest is used by the hardware (mostly by the GPU), you will never have access to it.
Your situation is perfectly fine, the biggest memory hog is the browser. I recommend auto memory manager (free on market) and set the empty application line to 80mb.
The services are killed automaticly by android, no need for task managers, but the limit is set to 80mb instead of 24mb. You will still run into memory leaks eventually, but not really at 30mb left.
Thanks to all
I do not use task killer, using linux for 4 years , i try Auto Memory Manager. see if the situation improves.

Reduce RAM available for caching apps

Hi guys,
So I've been running Deviant AOSP rom by Droyd for a while. Not sure if this is rom-specific, but I noticed that a lot of ram is being saved for cached apps. Even though it would appear that I have ~300mb of RAM available, only ~30mb is truly available since the rest (~270mb) are used for caching apps. My home launcher and Google Voice keep getting killed in the background because of that. Anyone got the same problem? Is there a way to ;limit the size of RAM that is available for cached apps?
I am definitely not running too many apps at the same time. The problem is that Android System keeps caching apps that I ran previously, and as a result kills my background apps that I actually use.

[Q] Low memory - APPS

Dear Xperia L Geeks! I was happy that i have 5.8gb memory in my device for apps, but after little time i got mad when i saw that apps memory is only 1.5gb, now i cant install more apps due to low memory. Now what should i do? I am not a gamer, neither a apps geeks. I just use for email(SMTP) and for browsing purpose and some office utilities. Kindly suggest my step by step tutorial to increase the APPS memory, i have 16gb sd card and 3gb free in my device, but apps memory is all low. Kindly help
naeemdal said:
Dear Xperia L Geeks! I was happy that i have 5.8gb memory in my device for apps, but after little time i got mad when i saw that apps memory is only 1.5gb, now i cant install more apps due to low memory. Now what should i do? I am not a gamer, neither a apps geeks. I just use for email(SMTP) and for browsing purpose and some office utilities. Kindly suggest my step by step tutorial to increase the APPS memory, i have 16gb sd card and 3gb free in my device, but apps memory is all low. Kindly help
Click to expand...
Click to collapse
You can move apps to that internal memory no?...and 1.5 gb is more than required cz u said you are an average user...
Crytech said:
You can move apps to that internal memory no?...and 1.5 gb is more than required cz u said you are an average user...
Click to expand...
Click to collapse
Dear Crytech: Thanks for the reply, yeah i am a average user, but what i am using is SMTP email, few office utilities, one game, ftp clients etc, but its require space. umm i am having only 100mb free. Yeah i moved few apps into phone memory but cant move other heavy apps into phone memory. So now i think i dont have any option to increase the 1.5apps partition. As far as i know that this is only possible in root. But i am not familiar, (Root,Bootlocker). What should i do now to increase memory for apps?
naeemdal said:
Dear Crytech: Thanks for the reply, yeah i am a average user, but what i am using is SMTP email, few office utilities, one game, ftp clients etc, but its require space. umm i am having only 100mb free. Yeah i moved few apps into phone memory but cant move other heavy apps into phone memory. So now i think i dont have any option to increase the 1.5apps partition. As far as i know that this is only possible in root. But i am not familiar, (Root,Bootlocker). What should i do now to increase memory for apps?
Click to expand...
Click to collapse
Without Root nothing can happen...And afaik Apps partition cannot be increased w/o root....Can you give me screenshot of your apps memory?
producing neunio
Crytech said:
Without Root nothing can happen...And afaik Apps partition cannot be increased w/o root....Can you give me screenshot of your apps memory?
Click to expand...
Click to collapse
Please have a look on screenshot, i just got free few memory by removing some office utilities to work with other apps.
naeemdal said:
Please have a look on screenshot, i just got free few memory by removing some office utilities to work with other apps.
Click to expand...
Click to collapse
Dear i would appreciate if you can help me to root my Xperia L. So that i can finally enjoy.
A question for you...
naeemdal said:
Dear Xperia L Geeks! I was happy that i have 5.8gb memory in my device for apps, but after little time i got mad when i saw that apps memory is only 1.5gb, now i cant install more apps due to low memory. Now what should i do? I am not a gamer, neither a apps geeks. I just use for email(SMTP) and for browsing purpose and some office utilities. Kindly suggest my step by step tutorial to increase the APPS memory, i have 16gb sd card and 3gb free in my device, but apps memory is all low. Kindly help
Click to expand...
Click to collapse
Hi naeemdal,
I read your post with interest. It sounds like we've been having the same issue with available device memory on our Xperia Ls. By the sounds of it though, I may have more apps installed on my phone than you have. Having said that, I'm not a gamer.
For me it started about a month or so ago, when I began getting notifcations on the phone saying something like "Storage Space is running low, some functions may therefore stop working correctly". By that point I had only about 20 or 30 mb of available device memory remaining out of a total space (not including Internal Storage) of 1.57 gb. I didn't understand how the available memory can have gotten so low as I hadn't installed anything new recently.
Anyway, I removed whatever apps I could but the available device memory continued to drop, until eventually the phone started to malfunction. Various system apps began to fail or not start up properly on boot. The first thing to go I think was USB connectivity, then messaging.
So I backed up as much as I could and did the first of several full factory resets.
After closely monitoring my phone for large or sudden changes in the available device memory, I am fairly certain by now that my installation of Spotify (the music streaming app) is responsible for this problem. Let me explain why I think this: After the first factory reset, the first app I reinstalled was Spotify. The following day, the device memory started to fall until it reached 0 mb within about 48 hours and the phone began to malfunction. I then did another factory reset, but this time I installed all of my other main apps leaving out Spotify. I used the phone as normal for a few days and there was no change in the device memory. Only then did I install Spotify, and by the following morning the available memory had dropped from 1.11 gb to 1.08 gb (a drop of 30 mb). By the afternoon the available memory had further dropped (by another 90 mb) to 0.99 gb. I immediately cleared the Spotify data and uninstalled the app. More than 24 hours have passed since then but the available device memory has remained at 0.99 gb, i.e. not further drop in memory level.
The screenshots you supplied to Crytech are just what I've been seeing on my phone. Out of total space of 1.57 gb, you have 578 mb used for Apps and 216 mb Available. So what has happened the remaining 813 mb?
In light of this, my question to you is whether you too are a Spotify user? If you are, then Spotify's devs need to know about this.
Victoristics said:
Hi naeemdal,
I read your post with interest. It sounds like we've been having the same issue with available device memory on our Xperia Ls. By the sounds of it though, I may have more apps installed on my phone than you have. Having said that, I'm not a gamer.
For me it started about a month or so ago, when I began getting notifcations on the phone saying something like "Storage Space is running low, some functions may therefore stop working correctly". By that point I had only about 20 or 30 mb of available device memory remaining out of a total space (not including Internal Storage) of 1.57 gb. I didn't understand how the available memory can have gotten so low as I hadn't installed anything new recently.
Anyway, I removed whatever apps I could but the available device memory continued to drop, until eventually the phone started to malfunction. Various system apps began to fail or not start up properly on boot. The first thing to go I think was USB connectivity, then messaging.
So I backed up as much as I could and did the first of several full factory resets.
After closely monitoring my phone for large or sudden changes in the available device memory, I am fairly certain by now that my installation of Spotify (the music streaming app) is responsible for this problem. Let me explain why I think this: After the first factory reset, the first app I reinstalled was Spotify. The following day, the device memory started to fall until it reached 0 mb within about 48 hours and the phone began to malfunction. I then did another factory reset, but this time I installed all of my other main apps leaving out Spotify. I used the phone as normal for a few days and there was no change in the device memory. Only then did I install Spotify, and by the following morning the available memory had dropped from 1.11 gb to 1.08 gb (a drop of 30 mb). By the afternoon the available memory had further dropped (by another 90 mb) to 0.99 gb. I immediately cleared the Spotify data and uninstalled the app. More than 24 hours have passed since then but the available device memory has remained at 0.99 gb, i.e. not further drop in memory level.
The screenshots you supplied to Crytech are just what I've been seeing on my phone. Out of total space of 1.57 gb, you have 578 mb used for Apps and 216 mb Available. So what has happened the remaining 813 mb?
In light of this, my question to you is whether you too are a Spotify user? If you are, then Spotify's devs need to know about this.
Click to expand...
Click to collapse
Dear Victoristics: Thank you so much for the reply. I am using following apps;
1- Flahslight (Average)
2- NQ Andriod Booster
3- Airdroid
4- AndFTP
5- Angry Birds
6- Any.Do (Frequently using)
7- CamScanner (Frequently Using)
8- Chess
9- Chrome (Regular)
10- Clean Master
11- Daily Motion
12- DropBox
13- Dictionary (Local Language)
14- ES file Explorer
15 Facebook (Regular)
16 Fing Network Tool
17 FTP Cafe
18 GMAIL (Regular)
19 Gstring
20 Hotspot Shield
21- Kingsoft Office (Regular)
22- Minion Rush
23- Mx Player
24- Neo Reader
25- NQ Mobile Security
26- Office Suite
27- Live Tv channels
28- Photoshop
29- Power Toggels
30- Skype (Frequently Using)
31- Sound cloud
32- Team viewer
33- Temple run 2
34- Twitter (Frequently Using)
35- NQ Vault
36- Viber (Frequently Using)
37- Whatsapp (Frequently Using)
38- XDA (Frequently Using)
39- Y Mail (Frequently Using)
40- Youtube
41- Utorrent
I am not using all apps on regular or frequently basis. Whenever i need i use. But office regular, but i dont keep data in my app device so i move to internal memry sd card 0
Memory problem Xperia L
naeemdal said:
Dear Victoristics: Thank you so much for the reply. I am using following apps;
1- Flahslight (Average)
2- NQ Andriod Booster
3- Airdroid
4- AndFTP
5- Angry Birds
6- Any.Do (Frequently using)
7- CamScanner (Frequently Using)
8- Chess
9- Chrome (Regular)
10- Clean Master
11- Daily Motion
12- DropBox
13- Dictionary (Local Language)
14- ES file Explorer
15 Facebook (Regular)
16 Fing Network Tool
17 FTP Cafe
18 GMAIL (Regular)
19 Gstring
20 Hotspot Shield
21- Kingsoft Office (Regular)
22- Minion Rush
23- Mx Player
24- Neo Reader
25- NQ Mobile Security
26- Office Suite
27- Live Tv channels
28- Photoshop
29- Power Toggels
30- Skype (Frequently Using)
31- Sound cloud
32- Team viewer
33- Temple run 2
34- Twitter (Frequently Using)
35- NQ Vault
36- Viber (Frequently Using)
37- Whatsapp (Frequently Using)
38- XDA (Frequently Using)
39- Y Mail (Frequently Using)
40- Youtube
41- Utorrent
I am not using all apps on regular or frequently basis. Whenever i need i use. But office regular, but i dont keep data in my app device so i move to internal memry sd card 0
Click to expand...
Click to collapse
Thanks for the reply naeemdal,
It looks like you have a lot more applications installed than I do after all.
The only apps you use that I also have installed are Chrome, Clean Master, ES file Explorer, Gmail (disabled), Neo Reader, OfficeSuite (Pro) & Youtube. I'm really not sure therefore what it is, if anything, that your memory problem and mine have in common. Crytech, if you're reading this, do you have any perspective on what the problem might be here?
As I said, I believe that, in my case, the serious reduction in memory is connected with my installation of Spotify, so I intend reaching out to their support guys over the next week or two once I've monitored the situation and and tested a bit more.
Dear Victoristics,
I am using Spotify and I am having the same issue all the time.
Solving this problem I reset to factory settings over ten times already and installed the new firmware of Xperia L.
I havent installed a clean install of Android yet, maybe it will help. But I thought I will go to the shop and switch my phone to a new L and see if it happens there as well.
Greetings from Finland
My Xperia L and Spotify = the same problem.
I have to check if the problem exists on Xperia Tablet Z.
I'm curious is it Sony fault or Spotify.
I have Spotify and the same problem with the memory. But I also suspect that the problem may be motivated by the photos and videos. A few days ago I let the phone to my 7 years old daughter to record some videos and photos. When she returned me the phone were only 50 Mb of available memory, and I had left him with 250 Mb. And the Album App does not work well, occasionally I have the black screen.
Anyway if the problem is caused by Spotiy, I'm not willing to give up that application. I think it is Sony's responsibility to resolve this. I have Spotify in other devices and no problems.

How to limit RAM usage per application

Is there a way to set hard limits on how much RAM individual Android apps can use? Seems most apps are greedy, and I'm running out of RAM, which makes switching between the apps I am currently using slow.
I used Titanium Backup to freeze all apps I don't use frequently, and now my ram usage is down to about 50%, where it used to be around 90%.
I also use an app called Auto Memory Manager, which controls Android's own memory management. You can tell it to free memory sooner than later, for different types of memory categories. But what made the most difference was freezing apps with Titanium Backup.
I'd still like to know if there is a memory policing app, but the aforementioned are good solutions.

Categories

Resources