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
Related
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.
After googling and searching alot, i didnt find my answer
so hope someone can help me here, and this will help others too.
so install apps on SD Card or Internal memory ?
The internal phone memory is generally of a lesser amount than the amount of the memory you'd have on a SD card. You cannot really change the amount of internal memory you have on your phone but you can always get a new SD card with a larger storage capacity.
So when you have apps that need a lot of space it is better to have them installed on the SD card.
will installing more apps on internal memory make the phone run slower ???
I don't think it will make the phone run slower, but you'll have lesser storage space for your other data which is stored in the internal storage like your contacts etc.
i have an HTC Sensation XE running on Darkforest ROM, this is my RAM (pic) how can i increase the free memory, thats the max i get around 180MB free
View attachment 1034360
Can I know why you wish to free up the RAM? In most cases you really don't need to because the OS manages that quite efficiently. It will free up the RAM and make room for the running applications whenever it needs to.
cuz in some apps after opening them for a while and try to close this app the phone restarts, so i read that its cuz of low RAM
please correct me if am mistaken
180 mb is a lot of RAM for a single application to use. And as I said, the OS, is pretty good at managing it. Although I cannot exactly tell you why your phone might be restarting when you close some apps, I don't really think it would be cause of the low RAM.
I checked my phone and it had about the same amount of RAM occupied as yours(i.e. 2 thirds of the total capacity). Then i started a game called Fruit Ninja which uses 3d graphics, which should need a lot of RAM. Then i pressed home and checked the RAM usage again. Even then the RAM usage did not go up by much.
You should try to verify this on your phone too. Check the amount of RAM thats being used. Then start the application thats causing the problem. Press the home button and check the RAM usage again.
An app will probably run quicker from internal mem because flash storage is much slower, but youre'e limited by space constraints.
Sent from my MB526 using XDA
Well it might load into the RAM quicker. But I don't really think there is much of a difference in speed while its running. Unless there are a lot of loading and writing operations.
Pay attention to one thing: internal storage and ram are not the same thing.
Ram is commonly allocated on a high speed journaled partition and it is 1000 times or more faster than both the internal emmc or the external SD (that'd why a swap partition is not as fast as real ram).
Just for the I/O parallelism, an app installed on the external sd could very likely run faster than one that resides in the internal emmc. Anyway, it also depends on the class of the external sd, though the class counts only when writing sequential data, while reading could even be faster when using a lower class SD.
lucaoldb said:
Pay attention to one thing: internal storage and ram are not the same thing.
Ram is commonly allocated on a high speed journaled partition and it is 1000 times or more faster than both the internal emmc or the external SD (that'd why a swap partition is not as fast as real ram).
Just for the I/O parallelism, an app installed on the external sd could very likely run faster than one that resides in the internal emmc. Anyway, it also depends on the class of the external sd, though the class counts only when writing sequential data, while reading could even be faster when using a lower class SD.
Click to expand...
Click to collapse
Doesn't an application get loaded into the RAM first when its started? So would its execution speed still depend on the sd/internal memory?
I thought that would come into the picture only when theres some kind of read/write thats happening to the sd/internal memory...
Well, if it is true that any app run inside the dalvik vm and such vm is able to run simultaneously multiple apps in its sandbox, I suppose that any app could need to access its installation files and its stored data while running.... I am not sure, anyway, it is just what I believe it could be.
To be true, my supposition mostly derives from what I've experienced with chrooted linux, which run faster when the .img file is stored on the external sd.
Anyway, if it should be as you say, the app's speed would be totally independent from the support where it was installed.
lucaoldb said:
Well, if it is true that any app run inside the dalvik vm and such vm is able to run simultaneously multiple apps in its sandbox, I suppose that any app could need to access its installation files and its stored data while running.... I am not sure, anyway, it is just what I believe it could be.
Click to expand...
Click to collapse
That is what I exactly meant. Although it differs from case to case, an application typically loads all the stored data it needs at the start. And then throughout the execution of this application, loading/saving of data is generally rare.
Of course this is a very generalized statement and such things are handled differently by different applications depending on how they were implemented and what they are intended to do.
Consider for example a game. The game would load all the textures, images, music it would need for a particular level. Then throughout the entire period of the level the game wouldn't need to load any data. It is only when some different support data would be needed by the game, or if the player's state is to be saved there would be a read/write operation. At such a time only would there be a need to access the sd/internal memory. So it really doesn't make the difference of where the game is installed very noticable.
Now on the other hand if you have an application say an Image viewer application which loads an image from the the sd/internal memory every time the "next" button is pressed. Then, maybe you'd have a noticable difference based on where the image is being loaded from. But even typical image viewers implement some sort of image caching to reduce such excessive loading.
Widgets
I had a problem where apps that used a widget option did, not give that feature anymore when the app is moved to the SD card...
Hey guys .. today i increased my RAM using some methods on the internet but RAM Expander Didn't work it says : swapon sdcard/swapfile.swp invalid argument ... so my problem is i have used . Sawpit Ram Expander and succeed but when i check my ram .. it still the same no changes & nothing happened please help me ASAP​
Well you can add physical ram to a phone, you can flash a kernel or bootloader that reallocates some ram, but this is device specific and often takes some very intelligent programmers to make this happen.
The other way is to use virtual ram in the form of a swap partition, this will use sdcard or internal data or whatever partition you make work, function as ram, but it is slower than real ram and depending on how you use your device may make it slower altogether. I believe this is the method of increasing ram that you did, the easiest way to see if it worked is to open a terminal emulator and type
free
The final way is with compcache or zram, both squash ram and has a similar caveat to using swap as it may make things worse.
A few Google or xda searches should explain this a bit more than I have
Sent from my Nexus 4 using XDA Premium 4 mobile app
Thanks for your help
demkantor gonna try zram soon​
demkantor said:
Well you can add physical ram to a phone, you can flash a kernel or bootloader that reallocates some ram, but this is device specific and often takes some very intelligent programmers to make this happen.
The other way is to use virtual ram in the form of a swap partition, this will use sdcard or internal data or whatever partition you make work, function as ram, but it is slower than real ram and depending on how you use your device may make it slower altogether. I believe this is the method of increasing ram that you did, the easiest way to see if it worked is to open a terminal emulator and type
free
The final way is with compcache or zram, both squash ram and has a similar caveat to using swap as it may make things worse.
A few Google or xda searches should explain this a bit more than I have
Sent from my Nexus 4 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
Rooted !
Is the ram expander really works? Because I'll try a lot of times for increasing my device ram. But it wont work. What can i do now?
Sent from my Micromax A065 using XDA-Developers mobile app
No it slows your device down . Wrong forum btw
The strange thing I noticed to, was that the drive cache option, only applies to the internal storage, even if you do select the EXTSD.
If that was not bad enough, you should also check this article. Which goes into detail about the read head buffer (Same as drive cache).
I think the only true way where you can get more memory, is to download a custom kernel and tweak the zram (If defaults are not quite enough). All it does is allow compression on ram, the only downside is that the performance is affected in some way. But for me I have not noticed the difference.
i have used it but have found no significant changes on how my phone handles RAM
Sent from my Flare_S4 using Tapatalk
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