I attempted to find an answer to this question but was unsuccessful. I'm not sure if my understanding of the Dalvik max heap size is incorrect or if there is some other aspect of memory management I am not understanding. I'm basically trying to get an understanding of how memory is used in Android.
I am looking at a fairly large application that is ran through an emulator. I set Max VM application heap size to 24MB in the AVD. I then run the application and run procrank on it. It shows the application is using about 50MB. How does this correspond to heap size? Why is the application showing 50MB when the max heap size is only 24MB? After messing around with the application I see memory jump to over 100MB. This seems terribly high to me but I don't know enough to say definitively.
Also, if I run MAT on it I am getting a totally different thing. I don't really understand what data is coming from MAT. It is showing a total of 3.4MB with most of it unused. What does this mean?
I've tried to read as much information as I can about memory usage but I think I'm just not quite understanding it. Any explanations or links would be very much appreciated.
Thank you in advance.
hi evryone i've bin looking around for a while now and i can't seem to find the exact thing/explenation i am looking for.
i would like to know what the following are used for.
simply a more value means this
less value means that
if its possible what i understand from it for now is
Min Free KBytes(obvious is suppose)
Dirty Ratio(controls the delay of the kernel writes to data why is this important?so i can control how long it takes for him to flush his memory ?)
Dirty Background Ratio
VFS Cache Pressure(smaller value is bigger cache wich in the end could bite me in the ass ??)
Oom Allocating Task(instead of scanning what to kill it kills whatever made it exceed the memory??)
all i could find on google is people and there prefered settings.
wich could be amazing but aslong as i dont SEE a difference seeing my phone runs smooth to begin with
its rather hard to find out what it does
ty in advance
edited for overview
Originally Posted by*CALIBAN666*
I think its better to Post this here,when its not better,than sorry!!!
-----------------------------------------------------------------
Once a brief statement for those who are not traveling so long in the Android scene:
ZRAM = ramzswap = Compcache
In order to explain more precisely ZRAM first need other terms are more clearly defined:
Swap can be compared with the swap file on Windows. If the memory (RAM) to complete the PC the data that are being used not actively outsource (eg background applications) so as to re-evacuate RAM free. To this data is written to a hard disk. If required, this data is then read back from there easily. Even the fastest SSD is slower than the RAM. On Android, there is no swap!
In ZRAM unnecessary storage resources are compressed and then moved to a reserved area in the fixed RAM (ZRAM). So a kind of swap in memory.
This Ram is more free because the data then only about 1/4 of the former storage requirements have. However, the CPU has to work in more because they compress the data has (or unpack again when they are needed). The advantage clearly lies in the speed. Since the swap partition in RAM is much faster than this is a swap partition on a hard drive.
In itself a great thing. But Android does not have a swap partition, and therefore brings Android ZRAM under no performance gain as would be the case with a normal PC.
In normal PC would look like this:
Swap = swap file (on disk) -> Slow
ZRAM (swap in RAM) -> Faster than swap
RAM -> Quick
With Android, there is no swap partition, and therefore brings ZRAM also no performance boost.
The only thing that brings ZRAM is "more" RAM. Compressed by the "enlarged" so to speak of the available memory. That's on devices with little RAM (<256MB) also pretty useful. The S2 has 1GB but the rich, and more than. There must not be artificially pushed up to 1.5 GB.
After you activate the ZRAM also has 2 disadvantages. The encoding and decoding using CPU time, which in turn has higher power consumption.
Roughly one can say (For devices with more than 512MB RAM):
Without ZRAM: + CPU Performance | + Battery | RAM
With ZRAM: CPU Performance |-Battery | + RAM
For devices with too little RAM so it makes perfect sense. But who shoots the S2 already be fully complete RAM and then still need more?
Check whether you can ZRAM runs in the terminal with
free or cat / proc / meminfo
I hope it helps to understand zRam!!!!
Sent from my GT-I9300 using XDA Premium 4 mobile app
I have a dual boot Android 5.1/Win 10 tablet (the Onda oBook10) that I recently managed to acquire root on (for any owners of this device that would like to know how, I'll be posting a guide soon). This thing has 4 gigs of RAM, but starts kicking apps out as soon as 1 GB is occupied. I've tried setting minfree using both Kernel Adiutor and by echoing manually to /sys/module/lowmemorykiller/parameters/minfree, but neither has any effect. I know that this change doesn't persist across reboots on any Android, but in this case, it has no effect even on the current session. What's even stranger, going by the default values that have been set, there shouldn't be any issues at all - it's actually less aggressive than most other devices I've seen. The values are:
Code:
13107,16384,19660,22937,26214,32768
According to Kernel Adiutor, that translates to (in MB):
Code:
51,64,76,89,102,128
Yet, running apps shows 2.8 to 3.1 GB free constantly, even though apps are reloading.
Does anyone know what might be causing this? It's an x86 device, in case that's relevant. I have access to the boot image (in case it's some kind of kernel flag), and can unpack to ramdisk and zImage, but I have no experience with kernels, and have no idea where to even begin looking; if someone could point me in the right direction, that would be awesome.
Thanks,
SirVer
I made this Magisk Module for Oreo to see if I could reduce the lag
Check and share your results
PS: I'm going to push updates to the SSSB tg channel more likely than here
PS2: Someome mentioned me a module in the repo after I made this, I tried and it made my phone stuck at boot logo.
For those who are not into this, taken from RAM Truth:
Using swap increases your CPU usage, especially with zram where constant compression and decompression is going on (like using zip files on your PC), and is rarely beneficial on modern devices. Despite this, it's made a resurgence in the market.
Swap - A virtual memory scheme to increase your apparent total RAM. Unless you installed a modification to put this in storage, if you have swap you probably have a compressed block of RAM (called zram) acting as a virtual hard disk for this.
Users with rooted devices can very probably find kernel helpers or mods to let you change or turn off swap.
Daved+ said:
I made this Magisk Module for Oreo to see if I could reduce the lag
Check and share your results
PS: I'm going to push updates to the SSSB tg channel more likely than here
PS2: Someome mentioned me a module in the repo after I made this, I tried and it made my phone stuck at boot logo.
Click to expand...
Click to collapse
Just want to know the TG channel link, to stay up to date, thank you for the work it increase performances a bit .
zinou213 said:
Just want to know the TG channel link, to stay up to date, thank you for the work it increase performances a bit .
Click to expand...
Click to collapse
Info is in my sig
BTW I'm using this in Nougat with excellent results.
Thanks for this - been running it for a week and all is good.
I wanted to check in for updates, but not sure where / what the SSSB Telegram channel is?
Anyway you could link a new version?
Has this truly reduced lag?
I ask since there's mixed views online about disabling swap.
Thanks Daved+. Module does exactly what it was suppose to do. It saves me one less line in App2SD or Kernel Adiutor when disabling ZRAM.
For people reading. ZRAM is a compromise between increased multitasking and performance. The informations are clear as to how Swap partition works. It is up to you to decide what is more important to you.
baldybill said:
Has this truly reduced lag?
I ask since there's mixed views online about disabling swap.
Click to expand...
Click to collapse
Depends on the firmware. Disabling swap made my H918 more snappy for sure on both Nougat and Oreo, but when I had my V30 disabling it actually made it worst. Definitely a try and see. Also Swap torpedo on the magisk repo does this same exact thing just FYI for people wanting to know.
Kernel auditor have this function too in Virtual memory. Thing is i don't know the right settings to use
Ex Kernel manager has this function as well. I turned off zram which takes a few minutes, prolly a reboot would be quicker. Didn't observe any major change but I didn't test it exhaustively so turned it back on. I don't like changing things when I don't fully understand what's going on. I don't have any lag now anyway, nothing like it was when I used it in stock form anyway.
Thank you, It works well on my lgv20
Daved+ said:
I made this Magisk Module for Oreo to see if I could reduce the lag
Check and share your results
PS: I'm going to push updates to the SSSB tg channel more likely than here
PS2: Someome mentioned me a module in the repo after I made this, I tried and it made my phone stuck at boot logo.
Click to expand...
Click to collapse
On other side rather disabling swap i want to know if decreasing swap size worthy if don't want to disable zram totally.