[Q] problem in my device in RAM memory - Android Software/Hacking General [Developers Only]

in my device htc one x mt6577 it have ram 1g but always used 802mb and free 186mb its high usage of ram and in same time i dont open any app and when i connect device to computer and run eclipse program this appear in this picture
in attachment
it appears 82% of ram uknown it need same to format it how i solve it please help me​:crying:

From the SuperCharger OP...
RAM Lesson:
Important Note: FREE RAM IS NOT WASTED! - Read Linux Memory Consumption
...................... That article TOTALLY confirms what I've been saying!
To Summarize: Article: "Performance degradation occurs when "Absolute Free Memory" (includes Cached RAM) decreases."
...................... Me: "Lag happens when free ram goes below the 'lag level'"
Same thing, different language
Big Thanks to dev hardcore and this post for helping me figure stuff out way back when
Click to expand...
Click to collapse
Most tools/apps, when they report free ram, include cached apps and buffers and is much higher than what is truly free (which is what is shown by typing "free" in terminal emulator)
So, if something is telling you that you have high ram usage when "nothing is running", it may not be telling you what you think it's telling you lol
To see what's really going on, do in terminal:
free
or
cat /proc/meminfo

Related

[CompCache] Setting compcache to full RAM size

I've always run compcache on my ROMs when possible and I recently had the idea that setting the full amount of RAM to compcache could be an interesting test. The theory being that it may be slightly slower overall to have ramzswap compressing pages, but minfree would have heaps of memory to play with and apps would never quit, so multitasking would be faster as no apps are writing out to /data and then having to relaunch when I switch to them again.
I've set compcache with the init script like so
Code:
insmod /system/lib/compcache/ramzswap.ko;
rzscontrol /dev/block/ramzswap0 -i -d 98304;
busybox swapon /dev/block/ramzswap0;
And Linux reports the swap is working
Code:
# free
total used free shared buffers
Mem: 107332 105972 1360 0 8
Swap: 98296 48940 49356
Total: 205628 154912 50716
But no matter what I do, even if I launch a heap of apps, I can never get swap usage above the ~48Mb RAM seen here.
Furthermore, apps like Auto Killer and Free Memory only report I have 102Mb RAM total.
What's going on here? Why does Android think it only has 100Mb when free is reporting near on 200Mb total? Why does compcache only fill up halfway and no more? Does this mean that ~48Mb RAM is the "sweet spot" for compcache and any more is pointless?
The phone does feel faster when switching between apps but I could just be imagining it. Out of interest this is a 32B Magic running Dwang 1.17.1, which is basically just Donut AOSP with a faster framework and kernel.
Any ideas/help/suggestions would be appreciated?
Swap is never, ever, regarded by the system as real memory, hence why the system won't report it, since you really only have ~100 mb physical ram.
As to why you're only using 48, I believe that 48 is 1/2 96, so it probably means pages are being compressed 2:1, so the full memory is being compressed and dumped into RAM, and it only occupies 48 MB, leaving you 48 free for other processes.
Again, remember comcapche is swap, not real memory.
jubeh said:
Swap is never, ever, regarded by the system as real memory, hence why the system won't report it, since you really only have ~100 mb physical ram.
As to why you're only using 48, I believe that 48 is 1/2 96, so it probably means pages are being compressed 2:1, so the full memory is being compressed and dumped into RAM, and it only occupies 48 MB, leaving you 48 free for other processes.
Again, remember comcapche is swap, not real memory.
Click to expand...
Click to collapse
I don't think that that analysis is quite right....
First off, you MUST maintain SOME amount of real memory available... otherwise it'll crash in a spectacular way. I believe that the linux kernel itself may have a safety feature that maintains a certain minimum amount of physical ram available. There ARE certain things that the linux kernel will not be willing to swap, such as ITSELF.
Just imagine what would happen if the kernel swapped itself..... any attempt to do this wouldn't end well. Especially if it tried to swap its ENTIRE self since the kernel MUST be in memory in order for it to run.
There is also the swappiness setting... it controls the system's tendency to swap.
And finally, there is the possibility that you may simply not be starting enough processes to consume the full memory!
So imagine this; you have your compcache set for a certain size. It grows to that size and then finally, the kernel says "screw you, you can't have any more memory!" blows an error back to compcache, which complains back to the kernel "sorry, swap is screwed." Yep.... the kernel tells compcache which tells the kernel rather than the kernel just knowing.
You definitely don't want this happening.
Note: I can forsee some serious stability problems that this could result in related to the low memory process killer. Specifically, your compcache grows to its maximum allowed size, you start an application, the low memory process killer figures that you've got plenty of memory available, doesn't kill anything off, tries to start some application, crashes spectacularly when the kernel complains back that it doesn't have any memory. I don't know if this would happen with a stock low memory process killer, but definitely would with the swap hacks added....
lbcoder said:
Note: I can forsee some serious stability problems that this could result in related to the low memory process killer. Specifically, your compcache grows to its maximum allowed size, you start an application, the low memory process killer figures that you've got plenty of memory available, doesn't kill anything off, tries to start some application, crashes spectacularly when the kernel complains back that it doesn't have any memory. I don't know if this would happen with a stock low memory process killer, but definitely would with the swap hacks added....
Click to expand...
Click to collapse
92 MB of compcache doesn't really need 92MB of compcache... that's the point of being compcache.
Compcache file in RAM grows when cache gets stuffed inside compcache.
Setting a low swappiness will cause compcache to just swap what's needed.
And even with full compcache, in the end you end up having around 140 mb (or so) free ram. 92mb of compcache that takes like 50mb and 42 extra mb of normal ram.
I think this idea is great (I was just too lazy to try yet...). Instead of dalvik vm having to free up memory it can stuff some more mb in compcache. should be faster.
I didn't really think my post through... but I hope some of you understood some of the things I wanted to communicate xD
domenukk said:
92 MB of compcache doesn't really need 92MB of compcache... that's the point of being compcache.
Compcache file in RAM grows when cache gets stuffed inside compcache.
Setting a low swappiness will cause compcache to just swap what's needed.
And even with full compcache, in the end you end up having around 140 mb (or so) free ram. 92mb of compcache that takes like 50mb and 42 extra mb of normal ram.
I think this idea is great (I was just too lazy to try yet...). Instead of dalvik vm having to free up memory it can stuff some more mb in compcache. should be faster.
I didn't really think my post through... but I hope some of you understood some of the things I wanted to communicate xD
Click to expand...
Click to collapse
Interesting in theory, but if you actually read what I said, you would note that this is entirely IMPOSSIBLE and would crash spectacularly if not for and in some cases in SPITE of certain safety features built into the kernel.
Note: If you have 70 MB worth of data that CAN'T be swapped, that leaves 20 MB ***PEAK*** available to compcache.
It is neither fair nor sensible to think of all memory as being equal. Running processes ***MUST*** have REAL MEMORY.
A little off-topic, but this discussion (the possibility of REAL "compressed" memory) sparked a thought/question:
Would/could KSM* bring any benefit to Android? (Not sure if the KSM module can even compile/work on ARM)
I know KSM is normally used for detecting and sharing duplicate pages among KVM guests, but I wonder how many pages in a typical running Android installation are duplicated, and thus candidates for sharing/de-duplication.
*I can't posts links yet, so those that don't know what KSM is, will just have to google for it.
lbcoder said:
There ARE certain things that the linux kernel will not be willing to swap, such as ITSELF.
Click to expand...
Click to collapse
I was under the impression the kernel keeps itself in RAM and then reports free memory to the rest of the OS. This is why the phone physically has 192Mb RAM, but only reports 96Mb free (or 107Mb with RAM hack). Perhaps my understanding of Linux/Android memory reporting is not correct?
lbcoder said:
It is neither fair nor sensible to think of all memory as being equal. Running processes ***MUST*** have REAL MEMORY.
Click to expand...
Click to collapse
I think this is likely what is happening. Home, Phone, System and other processes with a low oom are refusing to swap out as they are still running. If the compcache allocation in RAM is dynamic as domenukk says, then those processes are occupying enough RAM that the ramzswap allocation can only grow to ~48Mb as I am seeing. I didn't think of this.
Nor have I tweaked swappiness. It's currently set to 60 (default) so I'd assume it's not too fussy with paging out. I will try playing with this at 10 and 100 to see if I can force anything more into swap or if it's less willing to swap.
brainbone said:
*I can't posts links yet, so those that don't know what KSM is, will just have to google for it.
Click to expand...
Click to collapse
I do not know either, but here are some links people may wish to look at
http://fedoraproject.org/wiki/Features/KSM
http://lwn.net/Articles/306704/
http://lwn.net/Articles/330589/
http://www.linux-kvm.com/content/using-ksm-kernel-samepage-merging-kvm
Ok I am not at all experienced in this area but this is just a suggestion. You say that you can only get 48mb of swap to be compressed at a time. If those 48mb were uncompressed, then that would occupy the 98mb you alloted to it. If you set the cc at say 128mb, then in (my) theory up to 64mb of it the actual ram would be used. I don't know how much sense I'm making but not sure exactly how to explain it. If you don't get it I'll try explaining my logic a little more in depth.
mejorguille said:
If you set the cc at say 128mb, then in (my) theory up to 64mb of it the actual ram would be used.
Click to expand...
Click to collapse
It appears you are right. Even with swappiness set to 100 and opening every app on my phone I'm not able to fill more than half of 128Mb compcache before minfree stats gracefully closing processes:
Code:
/opt/android-sdk-linux_86/tools$ ./adb shell free
total used free shared buffers
Mem: 107332 105956 1376 0 32
Swap: 131064 65520 65544
Total: 238396 171476 66920
Super Jamie said:
It appears you are right. Even with swappiness set to 100 and opening every app on my phone I'm not able to fill more than half of 128Mb compcache before minfree stats gracefully closing processes:
Code:
/opt/android-sdk-linux_86/tools$ ./adb shell free
total used free shared buffers
Mem: 107332 105956 1376 0 32
Swap: 131064 65520 65544
Total: 238396 171476 66920
Click to expand...
Click to collapse
I rock=p
So what's your performance like, compared to say 32mb cc or no cc at all?
It's different but I like it.
There is sometimes a slight (<2 second) pause when launching a new app (I assume this is compcache compressing old pages to swap to make way for the new app) however once the app is up and running, it almost never "exits" so switching between previously-launched apps is noticeably faster than without compcache. I run HelixLauncher Donut and it's never closed and re-launched while I've been trying this, however it did sometimes with 32Mb cc and quite often without cc at all.
I had 5 day uptime last week with 96Mb compcache (rebooted whilst testing another app for a friend) so I don't think stability is an issue. The CM wiki indicates performance with cc is better upon boot then gradually declines, even if that is the case, rebooting my phone once a week is no big issue.
Unless I run into any major issues, I'll be keeping my phone with large compcache
Super Jamie said:
I was under the impression the kernel keeps itself in RAM and then reports free memory to the rest of the OS. This is why the phone physically has 192Mb RAM, but only reports 96Mb free (or 107Mb with RAM hack). Perhaps my understanding of Linux/Android memory reporting is not correct?
I think this is likely what is happening. Home, Phone, System and other processes with a low oom are refusing to swap out as they are still running. If the compcache allocation in RAM is dynamic as domenukk says, then those processes are occupying enough RAM that the ramzswap allocation can only grow to ~48Mb as I am seeing. I didn't think of this.
Nor have I tweaked swappiness. It's currently set to 60 (default) so I'd assume it's not too fussy with paging out. I will try playing with this at 10 and 100 to see if I can force anything more into swap or if it's less willing to swap.
I do not know either, but here are some links people may wish to look at
http://fedoraproject.org/wiki/Features/KSM
http://lwn.net/Articles/306704/
http://lwn.net/Articles/330589/
http://www.linux-kvm.com/content/using-ksm-kernel-samepage-merging-kvm
Click to expand...
Click to collapse
ksm sound cool. As every app runs inside dalvik vm. Not sure though... somebody should ask cyanogen
I am happy thatlarge compcache works out so well for you.
BTW doesn't cyanogenmod 5 count the whole swap as real memory since test4 or so?
Oh and overclocking ondemand to as high as possible will speed up app opening and switching a lot while on compcache
domenukk said:
doesn't cyanogenmod 5 count the whole swap as real memory since test4 or so?
Click to expand...
Click to collapse
It's counted as available "swap" memory, but not "real" ram. Pages stored in "real" ram (memory that the cpu can directly execute code in) still need to be freed up (moved to swap) before previously swapped pages can be moved back in to "real" memory to be executed.
domenukk said:
ksm sound cool.
Click to expand...
Click to collapse
The beauty of KSM is that it does no "swapping". It simply combines 4KB pages that are identical -- so instead of two identical 4KB pages using 8KB of ram, they only take 4KB. The code is executed in place.
KSM would, however, still require swap. If at any time a virtual shared 4KB page is written to, it needs to be copied to a free page to avoid corrupting the virtual page it was a duplicate of before the write. Swap is needed to ensure that there will always be enough available free pages when this happens.
domenukk said:
As every app runs inside dalvik vm.
Click to expand...
Click to collapse
KSM is not dependent on a VM, but the existence of VMs (java or otherwise) increases the likelihood of duplicate pages.
domenukk said:
Not sure though... somebody should ask cyanogen
Click to expand...
Click to collapse
I'd certainly be interested in cyanogen's thoughts on this, but I'm sure there are others that would be able to chime in as well.
Relevant excerpt from kernel.org/doc/ols/2009/ols2009-pages-19-28.pdf
KSM and embedded
KSM is suitable to be run on embedded systems too; the important thing is not to register in KSM regions that won’t likely have equal pages. For each virtual page scanned, KSM has to allocate some rmap_item and tree_item, so while these allocations are fairly small, they can be noticeable if lots of virtual areas are scanned for no good.
Furthermore, these KSM internal rmap/tree data structures are not allocated in high memory. To avoid early out of memory conditions, it is especially important to limit the amount of lowmem allocated on highmem 32bit systems that might have more than 4GB of memory, but these shouldn’t fit in the embedded category in the first place.
Click to expand...
Click to collapse
Super Jamie said:
I was under the impression the kernel keeps itself in RAM and then reports free memory to the rest of the OS. This is why the phone physically has 192Mb RAM, but only reports 96Mb free (or 107Mb with RAM hack). Perhaps my understanding of Linux/Android memory reporting is not correct?
Click to expand...
Click to collapse
Memory reporting is a tricky thing.
But in general, when RAM is allocated to HARDWARE, it is NOT REPORTED.
The chunk of the 192 that is not reported is assigned PRIMARILY to the RADIO. Another chunk is assigned to the GPU. Still more is assigned to the AUDIO HARDWARE.
The part used by the kernel itself IS reported. The most trivial empirical evidence to prove this to you is that when you change KERNELS, it doesn't affect the total system memory, despite your KNOWING that different kernels use different amounts of RAM.
Another bit of empirical proof is that activating COMPCACHE does not reduce the total physical ram reported. And yes, COMPCACHE is part of the kernel...
Now here's another concept of crash and burn: IF everything in memory could be cached in compcache, then what would stop compcache from caching compcache in a horrible infinite memory sucking loop? That would be very very bad, LOL.
I think this is likely what is happening. Home, Phone, System and other processes with a low oom are refusing to swap out as they are still running. If the compcache allocation in RAM is dynamic as domenukk says, then those processes are occupying enough RAM that the ramzswap allocation can only grow to ~48Mb as I am seeing. I didn't think of this.
Click to expand...
Click to collapse
NOW you're getting the idea! Running processes, kernel, etc., all need physical RAM (though actually those processes you mention most definitely CAN be swapped...), and therefore you CAN'T make the ENTIRE RAM into compcache!
Nor have I tweaked swappiness. It's currently set to 60 (default) so I'd assume it's not too fussy with paging out. I will try playing with this at 10 and 100 to see if I can force anything more into swap or if it's less willing to swap.
Click to expand...
Click to collapse
Just beware of possible crash-and-burn
Super Jamie said:
It appears you are right. Even with swappiness set to 100 and opening every app on my phone I'm not able to fill more than half of 128Mb compcache before minfree stats gracefully closing processes:
Code:
/opt/android-sdk-linux_86/tools$ ./adb shell free
total used free shared buffers
Mem: 107332 105956 1376 0 32
Swap: 131064 65520 65544
Total: 238396 171476 66920
Click to expand...
Click to collapse
That doesn't actually follow from what you've posted here.
What follows is that 105956-(65520/2)=73196 of what occupies your memory can't be swapped (kernel, running processes, etc.).
lbcoder said:
What follows is that 105956-(65520/2)=73196 of what occupies your memory can't be swapped (kernel, running processes, etc.).
Click to expand...
Click to collapse
Do you know why swap constantly "settles" at almost exactly half usage regardless of what size compcache I set?
For example, I set 64Mb compcache yesterday and rebooted. Just using my phone normally (browser, genie widget, music) I have this:
Code:
total used free shared buffers
Swap: 63992 32096 31896
Does this mean I am effectively reducing the amount of RAM the phone has for the kernel, "foreground app", "visible app" and "secondary servers" (to use the minfree terms), whilst at the same time allowing more "hidden app" and lower processes to swap out instead of terminating gracefully?
This disturbs me
-------------------------------------
Sent via the XDA Tapatalk App
brainbone said:
I'd certainly be interested in cyanogen's thoughts on this, but I'm sure there are others that would be able to chime in as well.
Click to expand...
Click to collapse
He doesn't know much about it, yet. But he seems inerested.
Attached a short conversation over #twitter
# Dominik domenuk
@cyanogen Is ksm any good 2 save RAM? probably not - you would have already done it http://lwn.net/Articles/329123/
# Steve Kondik cyanogen
@domenuk I don't know too much about it, I think its meant for sharing between distinct virtual machines
@domenuk it could have a lot of potential though
# Dominik domenuk
@cyanogen basically yes. But he states its also for normal apps. I have no idea to what extend android apps have similar memory, though...
# Steve Kondik cyanogen
@domenuk a lot, Android is all about IPC and shared memory. I wouldn't be surprised if the Dalvik people are thinking about it.
Click to expand...
Click to collapse
Here is a way to make Android use more than 50 percent of a swap partition. I am not sure how it will act with compcache... Should be the same... Run the following commands from a terminal or add them following to your userinit.sh file:
Code:
su
echo 80 > /proc/sys/vm/swappiness
echo 150 > /proc/sys/vm/vfs_cache_pressure
!!WARNING!! - Messing with VM settings can cause data loss and system instability... Not liable for damages...
Using the above the "free" output is:
Code:
total used free shared buffers
Mem: 97708 95168 2540 0 356
Swap: 125296 88756 36540
Total: 223004 183924 39080
While we are at it... If anyone is willing... they can try this as well:
echo 1 > /proc/sys/vm/oom_kill_allocating_task
Reference : Article to Linux Insight
Been having pretty good results with it...
Here is a link to the rest of the vm settings...
Linux Insight article listing vm settings
L8r

Available RAM?

Hello,
I'm trying to fill a table useful to understand how much RAM is really available to the user in Android Phones.
Please try "Free Memory" by coconuts on the market or the "free" command in Terminal to let me know the total RAM of your device so that I can understand how much is reserved for hardware operations.
Please also say which ROM are you using.
Thanks
poochie2 said:
Hello,
I'm trying to fill a table useful to understand how much RAM is really available to the user in Android Phones.
Please try "Free Memory" by coconuts on the market or the "free" command in Terminal to let me know the total RAM of your device so that I can understand how much is reserved for hardware operations.
Please also say which ROM are you using.
Thanks
Click to expand...
Click to collapse
bit confusing how devices with 768mb ram have only 300mb free ram on boot.... 400mb+ ram already used by android (+sense)
then imagine a few years back devices had/still have 256mb ram..
olyloh6696 said:
bit confusing how devices with 768mb ram have only 300mb free ram on boot.... 400mb+ ram already used by android (+sense)
then imagine a few years back devices had/still have 256mb ram..
Click to expand...
Click to collapse
Some is for caching and used ram also means that it is used for a good cause but I think that android uses too much RAM, maybe it's a bit related to using Java... I cannot believe that very simple widgets eat 10-12 MB of RAM so easily.
The ram is supposed to be taken up. It allows programs to start really fast(normally). This is normal. The programs in memory are based upon what you use. Available ram is wasted space. I generrally only have ~100mb free and have 512mb total. My phone never slows except when a dev does not implenent a listview correctly. As for Widgets with big ram req that is also a developer thing.
Sent from my Incredible using Tapatalk
wow! 12mb for a widget?!
yeh i understand it runs in the background, but if you use task killers you gain more ram back... the free ram ensures better performance though? it isnt 'wasted' is it?
do htc widgets generally use alot of RAM?
olyloh6696 said:
wow! 12mb for a widget?!
yeh i understand it runs in the background, but if you use task killers you gain more ram back... the free ram ensures better performance though? it isnt 'wasted' is it?
Click to expand...
Click to collapse
it's not
android have it's own internal task killer and there is no need to install additional apps to manage RAM and keep free memory for... for what? system knows how much free mem is needed to run and will kill processes when needed.
and if you close app with task killer and then would want to run it again, it will actually take more time than if it would be kept in RAM.
deadwilder said:
it's not
android have it's own internal task killer and there is no need to install additional apps to manage RAM and keep free memory for... for what? system knows how much free mem is needed to run and will kill processes when needed.
and if you close app with task killer and then would want to run it again, it will actually take more time than if it would be kept in RAM.
Click to expand...
Click to collapse
I generally agree with you, but my heavy usage of android shows me that things can get really slow even on my oced G2, when the available ram gets under 40 things get messy, increasing the lowmem limit saved me a bit but I aim for a 768 MB minimum for my next phone.
a widget takes 12mb of RAM because of the heap size of the way android OS is setup. it assigns 12mb of RAM regardless of whether that widget needs it or not. check each process, every one shown in system panel will be a minimum of around 12mb or so, even something that is only 75k. just the way android works.
RogerPodacter said:
a widget takes 12mb of RAM because of the heap size of the way android OS is setup. it assigns 12mb of RAM regardless of whether that widget needs it or not. check each process, every one shown in system panel will be a minimum of around 12mb or so, even something that is only 75k. just the way android works.
Click to expand...
Click to collapse
That seems a bit uncomfortable to me
i personally think that it could be changed better by removing some apks or in other ways to reduce something
In my opinion it is nonsense that 1-4 MB stuff must reserve a minimum of ~12 MB of precious RAM. In this way we just lose resources that would be better used for actual data.
Sent from my HTC Vision using XDA App

Is the memory usage always so high?

Hey guys i have been enjoying my rooted sensation with ARHD 6.6.4 rom and its working perfect but i only have one issue.
Is the memory usage always so high?
I used this app called Memory Booster Lite and it shows used memory 75% and free only 23 or 25% always no matter how many apps or services i close.
Is this normal and is there any way to improve free ram memory?.
Thanks
Anything above 150 MB free memory is considered good in my books.
Most custom ROMs will get you between 200-250 MB free memory, which is normal.
You don't need to improve the amount of Free RAM you have at any given time. And your memory booster app is probably counter productive to achiving improved performance.
When you load an Android App, it will stay in RAM until something else needs that memory. It's not supposed to get dumped out of RAM just because you close the app.
If you have 100mb of RAM (using easy to work with numbers here) and an app takes 50 MB of RAM and anothe rapp takes 25MB of RAM, both apps will stay loaded in RAM so make them load quicker if you go to use them again. This saves load time and battery as the phone doesn't have to spend energy to transfer the app from storage back into RAM.
So in this scenario you'll have 25MB of RAM left.
Now say you want to load a 3rd app that takes 50MB of RAM. Obviously you don't have enough RAM to load it, so the system will now dump the other 50MB RAM user so it has room to load the new 50MB into RAM.
The system does it all for you natively so you don't need memory improvement apps. All they do it use up RAM permently (since they keep themselves in active memory and won't let themselves be killed) and use up extra battery power because they perform a task that will be performed again by the system later.
Android is very efficient at dumping apps form RAM when not in active use.
Over the course of a battery cycle you'll find that you use the same apps multiple times in a row. The phone app, text app, web browser app, etc are all things that you will use over and over and over. So rather than dumping these out of memory it keeps them so they load faster the next time. And it works VERY well. And it custom tailors itself to the user. If you never use the text app, but use Angry Birds all the time, Angry Birds will stick in RAM.
Sense is a RAM hog. If you want more RAM use AOSP. Having said that, free RAM is wasted RAM.
Sent from my HTC Desire S using xda premium
Skipjacks said:
You don't need to improve the amount of Free RAM you have at any given time. And your memory booster app is probably counter productive to achiving improved performance.
When you load an Android App, it will stay in RAM until something else needs that memory. It's not supposed to get dumped out of RAM just because you close the app.
If you have 100mb of RAM (using easy to work with numbers here) and an app takes 50 MB of RAM and anothe rapp takes 25MB of RAM, both apps will stay loaded in RAM so make them load quicker if you go to use them again. This saves load time and battery as the phone doesn't have to spend energy to transfer the app from storage back into RAM.
So in this scenario you'll have 25MB of RAM left.
Now say you want to load a 3rd app that takes 50MB of RAM. Obviously you don't have enough RAM to load it, so the system will now dump the other 50MB RAM user so it has room to load the new 50MB into RAM.
The system does it all for you natively so you don't need memory improvement apps. All they do it use up RAM permently (since they keep themselves in active memory and won't let themselves be killed) and use up extra battery power because they perform a task that will be performed again by the system later.
Android is very efficient at dumping apps form RAM when not in active use.
Over the course of a battery cycle you'll find that you use the same apps multiple times in a row. The phone app, text app, web browser app, etc are all things that you will use over and over and over. So rather than dumping these out of memory it keeps them so they load faster the next time. And it works VERY well. And it custom tailors itself to the user. If you never use the text app, but use Angry Birds all the time, Angry Birds will stick in RAM.
Click to expand...
Click to collapse
All of this. Every bit of it. I had to explain this to someone the other day who was hellbent on achieving MAXIMUM FREE RAM.
Skipjacks said:
You don't need to improve the amount of Free RAM you have at any given time. And your memory booster app is probably counter productive to achiving improved performance.
When you load an Android App, it will stay in RAM until something else needs that memory. It's not supposed to get dumped out of RAM just because you close the app.
If you have 100mb of RAM (using easy to work with numbers here) and an app takes 50 MB of RAM and anothe rapp takes 25MB of RAM, both apps will stay loaded in RAM so make them load quicker if you go to use them again. This saves load time and battery as the phone doesn't have to spend energy to transfer the app from storage back into RAM.
So in this scenario you'll have 25MB of RAM left.
Now say you want to load a 3rd app that takes 50MB of RAM. Obviously you don't have enough RAM to load it, so the system will now dump the other 50MB RAM user so it has room to load the new 50MB into RAM.
The system does it all for you natively so you don't need memory improvement apps. All they do it use up RAM permently (since they keep themselves in active memory and won't let themselves be killed) and use up extra battery power because they perform a task that will be performed again by the system later.
Android is very efficient at dumping apps form RAM when not in active use.
Over the course of a battery cycle you'll find that you use the same apps multiple times in a row. The phone app, text app, web browser app, etc are all things that you will use over and over and over. So rather than dumping these out of memory it keeps them so they load faster the next time. And it works VERY well. And it custom tailors itself to the user. If you never use the text app, but use Angry Birds all the time, Angry Birds will stick in RAM.
Click to expand...
Click to collapse
Wow thanks a lot for the explanation i really didnt know that.I got used to the pc ram optimizing hahahaha my bad.
so these apps android booster and memory booster shall i remove them all?
but apps running in background they dont drain ur battery?.
Like i am running music player and later i stopped it but its still there in process does it drain battery as long as its there in services?
High Always
Memory free has always been low to about 215 MB max. If you really want you can freeze sense and use a basic launcher from the play store to increase memory by about 50-70 MB.
Memory free is about 300 MB with Virtuous Inquesition 4.0.2 for me!
gamer1291 said:
Wow thanks a lot for the explanation i really didnt know that.I got used to the pc ram optimizing hahahaha my bad.
so these apps android booster and memory booster shall i remove them all?
but apps running in background they dont drain ur battery?.
Like i am running music player and later i stopped it but its still there in process does it drain battery as long as its there in services?
Click to expand...
Click to collapse
Yeah get rid of all that stuff.
And no, having an app loaded in RAM doesn't mean it's using processor power, which is what uses the battery. (Nor does it mean it's forcing the screen to stay on, which is your biggest battery drain)
Think of an app you just closed as a guy on a bus. He's just sitting there taking up a seat on the bus not bothering anyone. He doesn't weigh much compared to the bus itself so he's not decreasing the fuel efficiency of the bus. And when a little old lady needs to get on and have a seat, he'll gladly give up his seat for her and get off the bus....then patiently wait on the sidewalk for the next bus.
But as long as he's sitting on the bus quietly he's primed and ready to jump into the drivers seat if you need him to do so. Once he gets off the bus, it takes a second for him to reboard so he can drive.
well, all of this is so wrong... (this maybe true if gingerbread, but not ICS)
Read here:
http://developer.sonymobile.com/wp/2012/03/30/learn-about-the-technical-differences-between-gingerbread-and-ics/
http://source.android.com/compatibility/4.0/android-4.0-cdd.pdf
ICS is designed for 1GB RAM devices (eg: Galaxy Nexus),
and ICS need at least 340MB for linux user space + hardware functions (eg: camera, modem) + 64-128mb max for each running application
so ICS will need more ram than GB. that's why I think 100-150mb free ram isn't enough on Sensation-ICS, especially if you run heavy games that consume very big memory
Rotundjere said:
well, all of this is so wrong... (this maybe true if gingerbread, but not ICS)
Read here:
http://developer.sonymobile.com/wp/...ical-differences-between-gingerbread-and-ics/
http://source.android.com/compatibility/4.0/android-4.0-cdd.pdf
ICS is designed for 1GB RAM devices (eg: Galaxy Nexus),
and ICS need at least 340MB for linux user space + hardware functions (eg: camera, modem) + 64-128mb max for each running application
so ICS will need more ram than GB. that's why I think 100-150mb free ram isn't enough on Sensation-ICS, especially if you run heavy games that consume very big memory
Click to expand...
Click to collapse
Maybe you forgot nexus s or some phone with 512MB, i use it on ics and still smooth and no problem with gaming.
Google never explain how much ram requirements to run ics they just said about STORAGE minimum is 1GB.
One of the improvement of ics is on memory management, we can call it ram management.
In eclair you have to use ram management apps to kill your background tasks in order to run heavy apps smoothly, but in gb google made some improvement on ram management so we dont need an app anymore.
In ics google improve memory management again, thats why even you playing heavy games then minimize it and open browser or something else, you dont feel laggy browsing or because system will kill the game, and you have to start from scratch if you open the game again.
And 768MB is enough for me to run shadow gun, x-plane, gta 3.
Do some research before you say something mate.
And for free ram, i can get 300MB on MIUI sense based, but i dont even care, just leave it let system do the job.
C'mon, we dont need 300MB (except for show off ) what we need is smoothness and battery efficient.
Sent from my HTC Sensation XE with Beats Audio Z715e using Tapatalk 2
I thought that they did have rom management in older android versions. If all recent apps stayed open then it would crash the phone because it couldnt handle the load. And apps have different API levels which decided what apps were killed, depending on the kind of app(which you could change with an app). Ics and jb just have a better from management system. Correct me if I'm wrong
And could I hear more about the extra RAM?
Sent from my HTC Sensation 4G using xda premium
CerealFTW said:
I thought that they did have rom management in older android versions. If all recent apps stayed open then it would crash the phone because it couldnt handle the load. And apps have different API levels which decided what apps were killed, depending on the kind of app(which you could change with an app). Ics and jb just have a better from management system. Correct me if I'm wrong
And could I hear more about the extra RAM?
Sent from my HTC Sensation 4G using xda premium
Click to expand...
Click to collapse
Thats what i mean, in eclair phone become laggy when opened a lot of apps, but fixed on GB and more optimized on ICS.
Sent from my HTC Sensation XE with Beats Audio Z715e using Tapatalk 2
haha my bad. And is there really a 300mb ram hack in miui? This is the first I've heard of it
Sent from my HTC Sensation 4G using xda premium
In linux, the expression goes "free RAM is wasted RAM."
chrisund123 said:
In linux, the expression goes "free RAM is wasted RAM."
Click to expand...
Click to collapse
not true anymore, modern linux distro such as Fedora16 64-bit (kernel 3.x) only consume 320 MB of 8GB total RAM and 0 MB swap after start-up (no prefetch by default)
---------- Post added at 12:57 AM ---------- Previous post was at 12:51 AM ----------
aimcr7 said:
Maybe you forgot nexus s or some phone with 512MB, i use it on ics and still smooth and no problem with gaming.
Google never explain how much ram requirements to run ics they just said about STORAGE minimum is 1GB.
One of the improvement of ics is on memory management, we can call it ram management.
In eclair you have to use ram management apps to kill your background tasks in order to run heavy apps smoothly, but in gb google made some improvement on ram management so we dont need an app anymore.
In ics google improve memory management again, thats why even you playing heavy games then minimize it and open browser or something else, you dont feel laggy browsing or because system will kill the game, and you have to start from scratch if you open the game again.
And 768MB is enough for me to run shadow gun, x-plane, gta 3.
Do some research before you say something mate.
And for free ram, i can get 300MB on MIUI sense based, but i dont even care, just leave it let system do the job.
C'mon, we dont need 300MB (except for show off ) what we need is smoothness and battery efficient.
Sent from my HTC Sensation XE with Beats Audio Z715e using Tapatalk 2
Click to expand...
Click to collapse
yes of course you can run on sensation, but the system must kill other app running on background (just like my old moto milestone with 256mb ram kill app very frequently including homescreen launcher and it's very slow to start an app).
Read again the official Android 4.0 Compatibility Definition document:
http://source.android.com/compatibility/4.0/android-4.0-cdd.pdf
http://developer.sonymobile.com/wp/...ical-differences-between-gingerbread-and-ics/
Do some research before you say something mate.
sure, nexus s meet the android 4.0 ccd because it has more than 340 MB RAM, but it struggle just like 512 MB sony devices
128MB is a MUST for each app, but have to adjust more if needed. So next year or two, all phone manufactures will not ship devices with 512MB anymore coz it's too slow & will kill app on background frequently (just like my old milestone)
if you're not developer you won't encounter about memory hungry app, currently I make 3D games on android and <512MB devices (such as xperia mini ics) will automatically exit, because my game take to much ram and probably draw calls (but run very well on my pc), optimization is the only solution (reducing vertices/poly & texture size)
gamer1291 said:
Hey guys i have been enjoying my rooted sensation with ARHD 6.6.4 rom and its working perfect but i only have one issue.
Is the memory usage always so high?
I used this app called Memory Booster Lite and it shows used memory 75% and free only 23 or 25% always no matter how many apps or services i close.
Is this normal and is there any way to improve free ram memory?.
Thanks
Click to expand...
Click to collapse
haha.. you want more free memory? stop using a SenseUI rom...
trust me, youll get used to it. sense is nothing special after you get the full affect of an AOSP base
ALSO, just because memory is not free doesnt mean the memory isnt being allocated correctly. androids memory management is very intelligent. usually you dont need any task killers
chrisund123 said:
In linux, the expression goes "free RAM is wasted RAM."
Click to expand...
Click to collapse
Up to a point but beyond a certain threshold too little ram can cause lag, look in the v6 supercharger thread for more info on this
CerealFTW said:
haha my bad. And is there really a 300mb ram hack in miui? This is the first I've heard of it
Sent from my HTC Sensation 4G using xda premium
Click to expand...
Click to collapse
You can easily reach 280MB free on MIUI sometimes 300MB. But c'mon, do you really need it?
Rotundjere said:
not true anymore, modern linux distro such as Fedora16 64-bit (kernel 3.x) only consume 320 MB of 8GB total RAM and 0 MB swap after start-up (no prefetch by default)
---------- Post added at 12:57 AM ---------- Previous post was at 12:51 AM ----------
yes of course you can run on sensation, but the system must kill other app running on background (just like my old moto milestone with 256mb ram kill app very frequently including homescreen launcher and it's very slow to start an app).
Read again the official Android 4.0 Compatibility Definition document:
http://source.android.com/compatibility/4.0/android-4.0-cdd.pdf
http://developer.sonymobile.com/wp/...ical-differences-between-gingerbread-and-ics/
Do some research before you say something mate.
sure, nexus s meet the android 4.0 ccd because it has more than 340 MB RAM, but it struggle just like 512 MB sony devices
128MB is a MUST for each app, but have to adjust more if needed. So next year or two, all phone manufactures will not ship devices with 512MB anymore coz it's too slow & will kill app on background frequently (just like my old milestone)
if you're not developer you won't encounter about memory hungry app, currently I make 3D games on android and <512MB devices (such as xperia mini ics) will automatically exit, because my game take to much ram and probably draw calls (but run very well on my pc), optimization is the only solution (reducing vertices/poly & texture size)
Click to expand...
Click to collapse
Maybe 2 years later google will optimize more this beautiful os so it wont become recource hungry OS, do we really need smartphone with 4gb ram? So it will become so smooth.
Ive tried samsung GS advance and its smooth, maybe samsung do better job in term of software. but oh, i forgot GS advance still on GB
Sent from my HTC Sensation XE with Beats Audio Z715e using Tapatalk 2
And i do some research before wrote all this, i used to developed some rom for Neo.
And c'mon what SE said about ICS is ****, even their GB is laggy, too much issue, and when ics come, some people including me trying to make it smoother. But still there is an annoying issue with video recording.
Ive readed the link.
Sent from my HTC Sensation XE with Beats Audio Z715e using Tapatalk 2

Increasing memfree by changes in code

Hi all,
As the ram of device samsung device having 750 mb ram fills 90 %, launching video player or youtube results into huge slowdown, halts and ANR sometimes.
So what changes do i need to make in the android CODE, to increase the performance and free the memory, so that i get adequate amount of free ram (atleast 100 mb). I also need that the memfree in /proc/meminfo should be more than 50 mb.
halo_killer said:
Hi all,
As the ram of device samsung device having 750 mb ram fills 90 %, launching video player or youtube results into huge slowdown, halts and ANR sometimes.
So what changes do i need to make in the android CODE, to increase the performance and free the memory, so that i get adequate amount of free ram (atleast 100 mb). I also need that the memfree in /proc/meminfo should be more than 50 mb.
Click to expand...
Click to collapse
Free ram, is wasted ram. The Linux kernel always make use of all available ram in the best way it manages. Ram not used by programs, is allocated for caches and so forth, making the device faster.
kuisma said:
Free ram, is wasted ram. The Linux kernel always make use of all available ram in the best way it manages. Ram not used by programs, is allocated for caches and so forth, making the device faster.
Click to expand...
Click to collapse
Then how can i stop my device from halting as running video player or youtube is resulting into massive slowdown.
Seen this? Try it...
http://forum.xda-developers.com/showthread.php?t=2180150
halo_killer said:
Then how can i stop my device from halting as running video player or youtube is resulting into massive slowdown.
Click to expand...
Click to collapse
You need to find out what's wrong. If it's not a ram issue, you are wasting your time trying to optimize the ram usage. It may of course be a ram issue, but nothing you've said so far, convince me this is the case. A good start, is looking at the output of logcat.
kuisma said:
You need to find out what's wrong. If it's not a ram issue, you are wasting your time trying to optimize the ram usage. It may of course be a ram issue, but nothing you've said so far, convince me this is the case. A good start, is looking at the output of logcat.
Click to expand...
Click to collapse
Can you suggest what kind of things should i look for in logcat. Do i need to analyze the dumpstate also.
halo_killer said:
Can you suggest what kind of things should i look for in logcat. Do i need to analyze the dumpstate also.
Click to expand...
Click to collapse
The logs from ActivityManager is a good start. If your device got short of memory, it's killing of your tasks as never before. But be aware, it also kills of tasks when then becomes too many (> 15 sticky, per default). Also browse through the logs looking for anything suspicious. Since I don't know what's causing your problems, I really can't say what to look for - sorry about that.

Probably problem with RAM usage

Disclaimer: Yes I know, empty RAM is useless and Android will free RAM for the active app by suspending apps that I "have not used for a while".
I have a problem that the current active app is closed by the system because it gets out of main memory - well in fact that is an assumption, I still need to track that down. Interestingly in contrast to Lineage 15.1. my Linage 14.1 has a memory section in the settings app...
1) memory settings shows me that the mobile has 1,7gb - its supposed to have 2gb. I'd assume that this is the kernel
or something like that, but the kernel is listed as part of the "Android OS", so where are the 300mb?
2) The settings app shows the average usage for at least the last 3h which is pretty pointless. If the app did not run 2h 55 mins of it, runs 5 mins and then crashes the average RAM consumption is obviously low. How do I found out wether lack of RAM is actually the issue?
(I have seen similar issues on two phones with 2gb RAM and no issues an mobiles with more than 2gb, which makes me think it is about the RAM)
3) What can I do to solve the issue if lack of RAM is the reason? (besides buying a phone with more RAM) are there hacks available that lower the memory footprint of the OS, the UI ....
thank you.
HelloItsMe222 said:
Disclaimer: Yes I know, empty RAM is useless and Android will free RAM for the active app by suspending apps that I "have not used for a while".
I have a problem that the current active app is closed by the system because it gets out of main memory - well in fact that is an assumption, I still need to track that down. Interestingly in contrast to Lineage 15.1. my Linage 14.1 has a memory section in the settings app...
1) memory settings shows me that the mobile has 1,7gb - its supposed to have 2gb. I'd assume that this is the kernel
or something like that, but the kernel is listed as part of the "Android OS", so where are the 300mb?
2) The settings app shows the average usage for at least the last 3h which is pretty pointless. If the app did not run 2h 55 mins of it, runs 5 mins and then crashes the average RAM consumption is obviously low. How do I found out wether lack of RAM is actually the issue?
(I have seen similar issues on two phones with 2gb RAM and no issues an mobiles with more than 2gb, which makes me think it is about the RAM)
3) What can I do to solve the issue if lack of RAM is the reason? (besides buying a phone with more RAM) are there hacks available that lower the memory footprint of the OS, the UI ....
thank you.
Click to expand...
Click to collapse
If it's a RAM issue, you can try setting up the ZRAM mod on your device or you can try creating a "swap partition" similar to the swap partition used in Linux. ZRAM and swap partition are different from each other but they both basically convert a portion of your internal storage into a type of "virtual RAM", this might help give you more space to be used as RAM to keep your app/apps from crashing. It requires a rooted device though.
Take a look at this:
https://forum.xda-developers.com/showthread.php?t=2217202
Sent from my LGL84VL using Tapatalk
Thank you for idea & link - however, the latest version is almost 6 years old and download links are dead (dropbox 404), so that might be a dead end....
HelloItsMe222 said:
Thank you for idea & link - however, the latest version is almost 6 years old and download links are dead (dropbox 404), so that might be a dead end....
Click to expand...
Click to collapse
I didn't give you the link to use what was in the link, it was to give you a reference to understand what I was describing, then take that information and do some research to learn how to go about doing it using valid software from today.
Now, you just need to do the research to see the currently available options that offer the same capabilities and how to set it up. Why does everyone act like it is too much work to do some reading and learning for themselves, no one wants to think anymore, they just want a simple answer handed to them that requires no work. If you aren't willing to put some effort into learning something, then you just need to stop trying to change things about your device and just use it as it is.
Sent from my LGL84VL using Tapatalk

Categories

Resources