Random Access Memory (RAM) enlarge - Galaxy S II Q&A, Help & Troubleshooting

Hello,
I had times a question, unimpeded I want to increase the working memory (RAM) of my S2 with external SD card, is it possible?
thanks!

fener6-0 said:
Hello,
I had times a question, unimpeded I want to increase the working memory (RAM) of my S2 with external SD card, is it possible?
thanks!
Click to expand...
Click to collapse
Not possible. RAM is allocated and restricted for many other hardware in our device like camera, display, GPU, etc.
Just use ZRAM (swap) or ensure KSM (or other kernel mem saving features) is set with a high enough aggressiveness. By default in linux kernel, swappiness (swap) is set to 60. You can increase this at the expense of more CPU cycles. The same with KSM thresholds, but most KSM parameters are set/controlled by the kernel developer. Our device is old and 1GB doesn't play well with newer android versions.

Related

Reallocating RAM , possible?

Well, we all know the ray has 512 MB of RAM built in. But if you use tools like Android Assistant, it tells you you can only use about 332 MB of it. I searched in other forums and found out, the "hidden" part of the RAM is reserved for the gpu. My question now: is there a way to reallocate the RAM and get some of the reserved available for user apps? Because i constantly get freezes wit oom.
I dont how to do it , but i am also disappoint when i saw ray has only 315+ RAM , sony site says ray has 512 MB
I am sure if we try to re allocate it we will get problems , why not you try cyanogenmod ?
it is faster and less RAM intensive
i am running on cyanogenmod 7.2 , but if i use launchers like spb shell 3d , my free ram, even at reboot, max caps at 110 mb. thats nothing.
JayanWarden said:
Well, we all know the ray has 512 MB of RAM built in. But if you use tools like Android Assistant, it tells you you can only use about 332 MB of it. I searched in other forums and found out, the "hidden" part of the RAM is reserved for the gpu. My question now: is there a way to reallocate the RAM and get some of the reserved available for user apps? Because i constantly get freezes wit oom.
Click to expand...
Click to collapse
i think is possible but it will be worst! most of the phone speed is given by the gpu (example samsung galaxy ace has 800MHz but lower gpu alocated memory and the phone speed is a disaster)
I think the only way to 'gain' some extra RAM is enabling SWAP.
On my old samsung, I once had a swap partition of 256 to extend the memory.
The good: you have real extra ram
The bad :
-swapping is slowing down the phone, as the sd-card speed is never sufficient.
-SD-card will die sooner, as you read/write a lot to same partition.
So swapping is not advised to my opinion, and others.
Some way to make some memory free (and speed up your phone) :
Use a clean rom (like 4pda.ru) and with the "autostarts" tool, try to disable android apps that automatically try to start itself at boot, startup or other events.
I found out that a lot of android apps try to start themselves even when you plug in the power cable (google maps for example), or connectivity changed, application installed etc.
With the autostarts tool (or rom toolbox) you can influence these triggers to prevent apps to startup themselves in the background.

zram: yes or no?

Im using pacman 18 on my neo v (JB rom)
Never really had a ram problem untill lately, when i started using viber, whatsapp, swype...
Now phone is struggling, there are no cached processes and almost no memory free.
By default zram is using 18% of my memory.
I dont exactly know what is zram, googling didnt help.
If i understand correctly, there are 2 scenarios:
1) It compresses data that would be in memory anyway, so you gain more ram, at the cost of having to compress/decompress evey time.
2) Apps that would normally be killed, are kept compressed inside memory, for faster access, at the cost of 'live' memory.
Could someone please clarify this for me?
well i dont know many things either.
I just think of this as that:
there is a swap/page file in ram that compresses useless/unused apps in ram.
Something like NTFS compress ability.
if you are using windows you have probably noticed that in the properties menu it says compress file to save disk space.
Well it just compresses it in ram and when you will need it it will be decompressed.
That way you will have more ram but maybe lags when swiching to apps.
I dont know anything about pacman rom so i can tell you about your problem.
try deleting zram (it will probably be a script in init.d)
I know it compresses data in phone's ram.
My question is, where does that data come from?
1) If that data would be in memory anyway, and they are just compressed, it gives you more memory, at the cost of performance
2) If they were outside of memory, and zram puts the in memory compressed, you lose ram, but you gain performance.
Let me also rephrase:
If i disable zram, that data that it compressed, would still be in memory uncompressed?
Or they will not be kept in memory any more?
Sorry, my English isnt helping on this one...
gordito_gr said:
I know it compresses data in phone's ram.
My question is, where does that data come from?
1) If that data would be in memory anyway, and they are just compressed, it gives you more memory, at the cost of performance
2) If they were outside of memory, and zram puts the in memory compressed, you lose ram, but you gain performance.
Let me also rephrase:
If i disable zram, that data that it compressed, would still be in memory uncompressed?
Or they will not be kept in memory any more?
Sorry, my English isnt helping on this one...
Click to expand...
Click to collapse
From Wiki
"zRam is an available feature for certain distributions of Linux, that was previously called "compcache". It increases performance by avoiding paging on disk and instead uses a compressed block device in RAM in which paging takes place until it is necessary to use the swap space on the hard disk drive. Since using RAM is faster than using disks, zRam allows Linux to make more use of RAM when swapping/paging is required, especially on older computers with less RAM installed.
Even though the cost of RAM hardware is relatively low this feature still offers advantages for netbooks and other lower-powered latops, virtualization and in the case of embedded devices, especially those that use flash memories that have a limited lifespan, dependent on write-use and thus wear out quickly when used as a swap device."
So the data are still in RAM but compressed...yes if you disable Zram they will be still there but they will use more ram! You gain more free ram when u use Zram but your CPU load is higher so perfomarnce is almost the same..
Konstantinosj77 said:
So the data are still in RAM but compressed...yes if you disable Zram they will be still there but they will use more ram! You gain more free ram when u use Zram but your CPU load is higher so perfomarnce is almost the same..
Click to expand...
Click to collapse
Still not clear.
On linux, after ram is depleted, data is coming from page file (hard disk)
How does zram work?
Does it pre-occupy that space in ram?
Or when ram is depleted, zram is automatically enabled and it starts compressing data???
gordito_gr said:
Still not clear.
On linux, after ram is depleted, data is coming from page file (hard disk)
How does zram work?
Does it pre-occupy that space in ram?
Or when ram is depleted, zram is automatically enabled and it starts compressing data???
Click to expand...
Click to collapse
Read again the part from the wiki..it says that zram uses "a compressed block device in RAM" so yes it pre-occupy some ram like a swap file! Also read this http://forum.xda-developers.com/showthread.php?t=2023568

What are the memory parameters/attributes that adds up to the active memory?

I installed ram truth to get some information about my ram but i don't know what type of memory constitute the active memory and also how zram disk size affects the active memory.
I know that the active memory is the users memory minus the available memory. I know from ram truth info that the available memory is also the sum of the hibernating and the idle memory. So what are the memory usages that makes up the active memory?

Low Memory Killer, Zram settings for 2GB Ram

For reference, phone is on lineageos android 8.1, has 2gb of ram (1807mb to be exact). I currently have set zram at 256mb.
From monitoring personal usage, android straight up uses 1gb of ram (it goes as low as 900mb after internal app force kills, and as has a 1.2gb after opening some light apps but no internal app force kills).
For example, I know that if I play pokemon go, it will sometimes kill running background apps (like afwall and betterbatterystats), despite having 'enough ram'.
What I mean by this is, before launching pgo, the os with everything running normally (example- tasker, afwall, betterbatterystats) ram usage will be at 1gb.
After pgo launches, the game will use ~600mb of ram. This should leave a safe 200mb of free ram. However, any time I switch out of the game, android will kill the app despite ~200mb ram is free.
Playing pgo will also sometimes background apps as I mentioned, but it feels completely random. I could be doing the same stuff for 10 mins and it will kill the apps, but sometimes, I could be playing for 20-30mins and no background apps are killed.
I've played around with the LMK settings a bit, and I admit I don't understand the settings despite reading on the little, outdated documentation on it.
I don't know if the 256mb zram counts as reserved/invisible ram, but I did set it at 0 and didn't feel a difference.
I also tried the 'ram management fix' magisk module and again, didn't feel a difference.
tldr - How do you properly set LMK and zram settings. From personal usage, android seems to never use the last 200mb of ram for me and starts killing apps despite having ~200mb of free ram.
My answer may no longer serve you, but I hope to help other people.
As you already mentioned, the lmk cleans several applications before reaching that limit (minfree 200mb) the higher the number ... the more applications it removes, although drastically reducing the values would cause a ram saturation and give performance problems. I recommend that you put these values 9806,14136,17848,21560,24448,28278 and 1gb of Swap by default for 2gb of ram

Is there any way to extend phone ram?

Hi, are there any magisk modules or firm mods that can extend phone ram? Like add 2 or 4gb to ram from memory?
erpl said:
Hi, are there any magisk modules or firm mods that can extend phone ram? Like add 2 or 4gb to ram from memory?
Click to expand...
Click to collapse
You can simply expand the RAM memory virtually, for example using the 'Swap - no root' app.
Be aware that it will not work very fast (by default, RAM uses the high-speed LPDDR4 or LPDDR5 standard with their modifications. Its performance can be ten times faster than the built-in flash memory).

Categories

Resources