yashsingh1/xdaforums huggingface dataset:
[Nexus 5X Original Android Development] jugoslavpetrovic:
Thanks, and how to revert changes? Does this survive data or system wipe?
[Nexus 5X Original Android Development] TheTrippyOne:
It survives anything apart from a complete wipe of internal storage, to revert changes you just delete the script and the swap.file which you'll find in the emulated storage (as in /sdcard or /media/data/0).

If you want to keep the swap.file (if you have the space on your storage) then just don't run the script and everything is back to normal.

It's just instructional code so it doesn't make permanent changes other than to the immediate system when you run it via EXKM script, be prepared for one thing though, it takes time to stop zram when it's done after boot. I suggest you just copy the Sphinx kerel and open the second copy to remove the zram line and then use my script without the first "swapoff" line.

I just hit the limit, with Max Payne and Temple Run 2 as well as Chrome in two instances and tapatalk, messenger, phone and EXKM I think NFS booted out Max Payne from memory because it took several seconds to get back into that which means it was read from swap... No worries though, I've got 2GB of Swap, I can use this phone for weeks without filling that. Don't have to worry about swapping in or out unless memory is actually out and I've got 2GB at my disposal rather than 1.5GB and .5Gb used as swap for no good reason.
[Nexus 5X Original Android Development] jugoslavpetrovic:
Thanks a lot.

I will test this

---------- Post added at 22:51 ---------- Previous post was at 22:29 ----------

SWAP FILE took me 8.4GB and left me 3.2MB

Something is not right here
[Nexus 5X Original Android Development] nirogu325:
Whoops. I ran the last two lines together. My bad!
[Nexus 5X Original Android Development] jugoslavpetrovic:
[MENTION=9312961]TheTrippyOne[/MENTION]

Ok, so I figured that while I was copying lines the 3rd line got separated like:

dd if=/dev/zero of=swap.file bs=1024

count=208000

And it was supposed to be as one line:

dd if=/dev/zero of=swap.file bs=1024 count=208000

I deleted old swap file and then repeated those lines and then it appeared as 203MB I did put the script file and rebooted. Now I got swap.file as 203MB. I am sure it should be 10 times bigger. I just need to now figure out why is that...

I also added to script swappiness set to 30 so I dont have to hit apply on boot in EXKM.
[Nexus 5X Original Android Development] jugoslavpetrovic:
These...
[Nexus 5X Original Android Development] jugoslavpetrovic:
I added zero at the end of 208000 in line and I got 2GB swap.file

Here is how it looks like in EXKM
[Nexus 5X Original Android Development] jugoslavpetrovic:
I am running with this swap file 2GB and swappiness at 30 and LMK script for whole day. For me it seems lags and heating compared to zram with 1GB and 100 as swappiness.
[Nexus 5X Original Android Development] nirogu325:
You're not alone, I also experienced massive lags and Chrome refreshed more than before. Reverting everything.
[Nexus 5X Original Android Development] milouk:
How did you revert everything?
[Nexus 5X Original Android Development] jugoslavpetrovic:
That was my first reaction as well, but then I realizer that UKMS was on and as the Full governor, I thought I read somewhere earlier that it was on for the guy so I wanted to replicate the experience but I think he said something as Lower governor, but on my side instead of that After Boot it seemes that it was applying the Full UKMS governor.

Now, I think that might be the broblem, all together with thermal heating and obvious lags due to Thermal Throttling.

Once again I will test this from scratch and with UKMS off for today.
[Nexus 5X Original Android Development] nirogu325:
Deleted both the script and the swap file between reboots.

---------- Post added at 09:06 AM ---------- Previous post was at 09:03 AM ----------

I multitasked a lot while buying groceries and I didn't like the experience. I for one am not trying that again.
[Nexus 5X Original Android Development] jugoslavpetrovic:
The thing is that you cant delete the swap file if already run script after boot. So you first delete the script file or remove from boot up location and system boots normally with regular zRam and then you either delete swap.file if you need that space on storage or leave it as it is not active without that script that disables zRam and enables that 2GB /sdcard/swap.file as swap ram.
[Nexus 5X Original Android Development] milouk:
For the past two weeks ive been testing 3.1 without UKSM and without Zram - basically everything stock and ii think it is literally better battery and thermal wise
[Nexus 5X Original Android Development] jugoslavpetrovic:
Yeah, those constant compressing and decompressing and KMS looking for duplicated pages its all on CPU tasks, as I understand.

Its just the need to hack those limitation on the limiting ram need, lol with possibility not to get heavy on CPU and not to spent battery juice due to low battery profile and also not to heat it due to BLOD or the nice not hot feeling in the hand and Thermal Throttle... Oh, too much "not too", LOL
[Nexus 5X Original Android Development] milouk:
I feel the phone smooth enough even though woth 2 GB ram. Id rather have some more battery and a bit cooler phone rather than some extra slow ram.

I am still interesting though in a nice LMK config. If anyone has one.
[Nexus 5X Original Android Development] jugoslavpetrovic:
Well, better optimized LMK could be the sweet spot here :D
[Nexus 5X Original Android Development] :
Will send you that I played with that a lot before on my old device, just the time I remember how and why and send you.
[Nexus 5X Original Android Development] milouk:
Awesome, ill be waiting for your LMK config. In the meantime i will pick some LMK improvment commits when i go back at home.
[Nexus 5X Original Android Development] poondog:
About ZRAM - I've seen a lot of people arguing that it shouldn't be used on more modern devices with > 4GB of RAM

Google's documentation suggests that it helps with page cache thrashing to reduce jank

https://source.android.com/devices/tech/debug/jank_jitter

A lot of you guys might find this an interesting read, if you haven't already
[Nexus 5X Original Android Development] :
These are my actual settings and they seem to be working really good.

They are oriented for multitasking so less free ram possible.

Thanks to paget96 for these settings.
[Nexus 5X Original Android Development] jugoslavpetrovic:
So, is this supposed to be used with zram or without and if with what size and swappiness?
[Nexus 5X Original Android Development] milouk:
I will be using your config for the next days for testing. Morever as i said before im going to focus a bit more on LMK to see whether its worth it or not, so expect some related commits.
[Nexus 5X Original Android Development] Doomkopf:
I don't want to be offensive, but I don't think your config is very good, because you assigned so little memory overall. Especially "Hidden Apps" and "Empty Apps" are very important to app responsiveness (cold load, apps closed in android before), the more the better, because more closed apps are in memory and therefore load faster. Also you lowered the memory in all other categories (compared to default now), which causes more lag because apps get thrown out of ram faster and therefore sometimes have to get loaded from sdcard again which causes lag. Can you explain why you did what you did, maybe I didn't get this right? (Only began today starting to researching that)

Google "Tips on LMK parameters configuration" and click on the first link

At like 2/3 of the artikel, there's a section "Tips on LMK parameters configuration", that's a pretty nice guideline
[Nexus 5X Original Android Development] :
Kein problem mein Freund ?

You were not offensive you share your knowledge and that's the main goal of this thread.

However " content providers" and "empty apps" are the most important sections to watch and the safer to modify and lowering their values means that more apps will stay in RAM and higher values means that apps will be killed directly after use and that you will have more RAM available.

Best guide:

https://www.**********.com/tweak-android-low-memory-killer-needs/

(Replace stars by droid views ,without the space)

PS 1 : hidden apps is important too, it's the apps that you just left but didn't killed by swipping, too high value means that going back to the previous app will relaunch this app so basic multitask is dead so I suggest low values but depending on your use.

PS 2 : foreground app is the currently used app suggesting to set it to 10mb

PS 3 : these settings are not all so even extreme values will not kill system process because all apps are ordered with a number, the lowest number means that this app will never be killed.

PS 4 : I really recommand lspeed to get the right numbers depending on your use (gaming or multitasking or daily user)
[Nexus 5X Original Android Development] Doomkopf:
Haha yeah I referred on the same article :D

ok so now I understood it: Lower value means more ram for the category , right?

Then I like your config. Not much ram free but also not too much, nice balance. Just applied it, will report in a few days

cheers :)
[Nexus 5X Original Android Development] :
Read again my reply I modified it several times lol.

For example : empty apps with a value of 500 mb, so it means that if the free RAM is lower than 500 mb, the apps in this category will be killed. And if content providers was set to 400mb and the free memory was also below this level so the apps in this category will be killed, etc etc

Hope I'm helping ?
[Nexus 5X Original Android Development] :
Just sharing the LMK values for gaming /agressive/"battery" oriented.

I will just advice to change foreground apps to 10.

All credits go to Lspeed(Paget96).

I write "battery" because less apps in background means less apps eating your battery but these apps needs to be launched again that is using even more CPU than keeping in RAM so gaming settings are like the name say reserved for gamers or people who are using only one energivore app otherwise its adviced to use multitasking setup available few posts before.
[Nexus 5X Original Android Development] Doomkopf:
When changing Ram-management in L Speed, the log shows that L Speed also changes "LMK cost" to 64 (/sys/module/lowmemorykiller/parameters/cost) and "MinFreeKbytes" to 2704 (/proc/sys/vm/min_free_kbytes). This definitely changes how LMK behaives, because when I only set the threshholds in Kernel Adiutor (Foreground Apps,...), I only have 50MB Free Memory (checked in L Speed). When I change it with L Speed (same threshholds for foreground apps,...), i have ~200-300MB left. So we should take the variables into count when tweaking also :)

Edit: I just recreated these settings via init.d and Kernel Adiutor and had only 50MB free again. That leaves me to believe that the "background app limit" set to 29 is also important.
[Nexus 5X Original Android Development] :
Thanks for what you found!

I was wondering why it was more agressive when I applied the same settings with lspeed than exkm.

So now the question is how to apply these settings without Lspeed and does they worth it, anyway [MENTION=5533673]milouk[/MENTION] must have a look at Lspeed lol.
[Nexus 5X Original Android Development] milouk:
So far im testing your settings. Imnot comoletly satisfied as notifications from instagram never arrive unless i open the app. I will test Lspeed once i get Home.
[Nexus 5X Original Android Development] nirogu325:
Those settings you saw (and tried) on the picture are the values you will see from LSpeed. I already tried that app.
[Nexus 5X Original Android Development] milouk:
I was testing the first set of settings in the previous page, i will now test the settings in this page and see how it will perform throught the day. I think that Lspeed values are the ones in this page
[Nexus 5X Original Android Development] Gabryele1976:
Hi

Thanks for your amazing kernel
[Nexus 5X Original Android Development] milouk:
Thanks for your kind words. You havent applied correctly the script. Open the txt file copy the content and paste it in a newly created script in EXKM Script Manager
[Nexus 5X Original Android Development] Gabryele1976:
Ok, I have create e new script and I have copied the code. Launch the script and I have this message: no output

Is that correct?
[Nexus 5X Original Android Development] milouk:
Yes that means the script has been executed correctly. You should see cores go offline any minute now
[Nexus 5X Original Android Development] Gabryele1976:
Yeahh, perfect, thanks a lot

This script improve the battery save, is this correct?

Core control option must be disabled, correct?
[Nexus 5X Original Android Development] milouk:
Since it disables cores it should save some battery. As it seems core control is better left enabled. Also leave msm_thermal enabled
[Nexus 5X Original Android Development] Gabryele1976:
Perfect, thanks :)

Glasscannon is OK as gov profile? Or you suggest something else?
[Nexus 5X Original Android Development] milouk:
Currently im using Interactive governor with HawkTail profile. But GlassCannon is ok
[Nexus 5X Original Android Development] Gabryele1976:
Will try :)

thanks a lot
[Nexus 5X Original Android Development] :
That's why I said that these settings are really personnal so maybe try to decrease secondary server or service provider values. Because it's clear that the instagram service for that is killed, but I don't think the app need to be open.

Try and tell me if it's OK.

Just to know were you using gaming or multitasking profile, so I can tell to paget96 that his settings are killing insta notif.

---------- Post added at 03:35 PM ---------- Previous post was at 03:33 PM ----------

Yes I tell that in my posts, these settings are multitasking and gaming profiles, I'm not experienced enough to adjust perfectly all settings but it's strange that instagram is killed with multitasking ?
[Nexus 5X Original Android Development] nirogu325:
Exactly why I don't rely on apps like that anymore. Try the same settings you first posted for multitasking except for the Secondary Server and Content Provider values. Judging from the link you shared, those two values could be the ones affecting you (Instagram may use components that fall within those two categories). So try 108 for Secondary Server and 216 for Content Providers. Those are the stock values for those two. Since I do not use Instagram, let us know if it's still killed easily. Keep in mind I am also experimenting.
[Nexus 5X Original Android Development] :
Yeah but I was speaking for milouk, I don't also use instagram and I'm testing gaming profile that is even more agressive and I'm receiving my notifications.
[Nexus 5X Original Android Development] TheTrippyOne:
Yeah, without my additions to LMK that script will not work very well. I realised that you should probably just try "light" in Kernel Aduitor.

It has nothing to do with the swap, it's the ridiculous LMK behavior that we have to live with because the entire system is a crapshoot of idiotic code.

Using 1 GB of memory as waste to compress a swap file is a HORRIBLE solution and won't do anything positive for anyone, ever. You'd be better off just not using any swap file.

I sent my changes in a link to a patch to Milouk. He'll review it and decide if it's worthwhile, if he doesn't then I'll fork it and you can request it. I won't publish it because this forums isn't my main release source.
[Nexus 5X Original Android Development] TheTrippyOne:
And it is idiotic considering it's not needed in the first place since OOM which is the actual memory manager of Linux does that completely without LMK and it does it seamlessly with CPU's that are not nearly as slow as our hardware. You could get an athlon 500 from 28 years ago and it would do this faster.

The problem is Android. It's the worst of the worst picked to make the absolutely worst system that anyone could ever make.

You can run a full desktop with 2GB and a decade old CPU on Linux and you can run 10 full programs (not apps, full programs) on that and multitask on that without any problem without even touching the swap and if you did touch the swap, it's from swapping out old inactive tasks.

Android doesn't work like that at all, basically they said "we don't like how people can have fast devices and good memory management, we're going to ensure they cannot have that AT ALL".

And they did, holy hell did they ever ensure that no matter how much memory you have you'll never be able to use that memory for anything other than a vast wasteland for nothing and kill apps when you have several hundred of megabytes left.

It needs to be scrapped completely and have a new system take it's place because this idiotic use of CPU power for random tasks that do nothing at all (literally just do absolutely nothing) and apps that are 12MB big drawing 500MB of memory out of nowhere (memory leaks are allowed in the android userspace which means that the security is non-existent since you could just multidraw and hide any activity in there).

I've done my best with what we have but that you'll need 4GB on a PHONE when I can literally compile the whole system on an age old system with 2MB and still run a browser with no slowdown is a testament to the incredible ineptitude of Google programmers.

Oh, and if you didn't get the point, it doesn't help at all, and what you are talking about is zmalloc and cleancache which is already enabled in my kernel and in most other kernels.

It also doesn't work like that, even the programmers from google don't get the memory management of the Linux kernel. OOM handles that just fine and it's been built in since 1.0 Which is about the time when I started my contributions to the kernel.
[Nexus 5X Original Android Development] jugoslavpetrovic:
Tried zram off and LMK balanced or multitasking from L Speed. Either was, I believe even stock LMK, device was heating, draining batt and being hard to use due slowdowns.
[Nexus 5X Original Android Development] milouk:
Well, in the weekend im going to test msm_thermal patches from Jollaman. Im going to release test builds too for whoever has thermal issues. If it passes the testing stage it is going to make it in either 3.1 or 3.2
[Nexus 5X Original Android Development] jugoslavpetrovic:
But when I reverted my 1024MB 100swappiness script device is fine, lol. Wierd?
[Nexus 5X Original Android Development] milouk:
It could be a placebo effect or pure luck for example an app was running in the bg backing up data and thus the heat and when you changed your config it happened the app to have finished it task. It cannot be explained otherwise. Ill PM you when i have the preview eith the thermal patches.
[Nexus 5X Original Android Development] dodjob:
Hey there,

I hope this won't be too much of an OT but think that as soon as we've got here the best development for the N5X I may have a straight forward answer.

I own a N5X and a N5. I sent my device for repair (bootloop) a few weeks ago and had to revert to my n5 for two weeks.

I have the same ROM on both devices (AICP) and with Oreo 8.1 system, I could completely "clone" my install pretty straight forward (so same amount of apps in both).

I will be direct, my N5 is WAY faster and way more stable in performance than my N5x.

As I got my n5x back, I made the same procedure (cloud backup) and install of course your kernel because I had the best results until now.

It was quite fast for a day or so...and after a week of use, I get again a laggy, too hot..sometimes hardcore hanging phone.

Now my question, I flash rom from nearly the raising of xda, (on Wimo at the time) I don't think that I'm completely N00B even if I'm officially no developper, why can't I get a "acceptable" performance from my device? As soon as the OP has his hends deep in the system, He may has an answer/solution ;)

This is no rant, or noob statement. I really don't understand how I get nearly-as-good performances as on Stock for a week and then everything starts to lag like crazy.. and this absolutely not on my N5.

Please also don't think that I'm ****ting on developper work, I specially don't ^^ and it's the same on all rom/kernels anyway. It's just that I don't want to bin my *best camera until now* phone without a fair fight, and I may have missed something.

N5x, AICP 8.1, Sphinx Kernel OC (mostly UC at stock values), and mostly didn't change anything except Dirtyratio from Zram at 100 which helped for a while.

Hope I don't get OP in the wrong way, I really need help I think ^^

Regards,

H.
[Nexus 5X Original Android Development] jugoslavpetrovic:
I own the same both phones, but m N5 got wifi chip broken. It runs mostly well it just can't be used with wifi and thats a big deal for android, also sometimes reboot while in call. So, generally not usable. But I can agree with you for performance compartment, even though N5 is 2 years older and 32-bit it is somehow more responsive. Also, I thought there was something on my side that I get slowdowns after a week of usage of N5X and to that level that I have to factory reset to make it fine again, so generally I was thinking that some of a bunch of apps is doing this and I don't know which ones. Somehow I can't relate this to kernel.
[Nexus 5X Original Android Development] Doomkopf:
Sorry for OT on OT haha :D

Hey [MENTION=5533673]milouk[/MENTION]

hope you enjoyed your vacation :)

I have a feature request :D Can you include WiFi-Channel-Bonding support? With that, it's possible to use 40MHz Channels with this smartphone on 2.4GHz WiFi, not only on 5GHz.

I saw that feature on 3.4 Changelog in Shadow Kernel, however I can give you no commit because I found none :(
[Nexus 5X Original Android Development] milouk:
Hi my friend, i indeed enjoyed my vacations.

This feature is already merged in Sphinx since version 2.9 (check changelog) https://github.com/milouk/Sphinx-Kernel-Bullhead/commit/4beb48c103833af27395a0104f01e896eaea7391 .

Cheers.:highfive:
[Nexus 5X Original Android Development] Doomkopf:
LOL. So that's that wifi hack :D You are ALWAYS two steps ahead, you're awesome man :svetius:

Cheers ^^
[Nexus 5X Original Android Development] milouk:
I have noticed this too way before i started developing Sphinx. I guess it is due to some apps creating cache that makes the phone buggy. I mean if you clean install you ROM and not install any other apps i highly doubt it is going to lag after a week. Probably some apps are not optimized for N5X specs.
[Nexus 5X Original Android Development] milouk:
Hahaha yeah, i try to avoid scientific terms in changelogs like "wifi bonding , channels and Mhz" because not many users can understand what it means. So i thought "A wifi hack that makes internet faster" was more understandable. But yeah glad i covered you haha
[Nexus 5X Original Android Development] Benik3:
I have similar experience. 1-2weeks the phone is good, battery drain good and then it starts to be bad.

I don't have much of the apps, on background I just have Hangout and FB Messenger Lite...

It happens with any ROM and kernel in my opinion, but I'm starting to think, that newer Android is not so good for the Nexus 5x.

I remember when I had 0,8-1,2%/h drain in Deep Sleep. Now I get hardly 1,8%/h even with new battery and I have pretty big problem to have the phone usable more then 1 day even I don't use it much.

Before I had pretty good experience with DirtyUnicorn ROM, but they didn't released v12 for Nexus 5x for some reason :( (EDIT: Now I found, that there is unofficial release, I will probably try it :) )

I will probably move to Xiaomi Mi A2 Lite...
[Nexus 5X Original Android Development] koxalk:
Best app for this kernel ? I mean to manage settings
[Nexus 5X Original Android Development] milouk:
Ex Kernel Manager is a nice app to configure Sphinx
[Nexus 5X Original Android Development] :
I agree with you but sphinx has partially solved these problems.

For dirty unicorn, there was unoficial but the dev's device is dead so no more builds...

And xiaomi, really ? , killing our economy by buying devices that are just cheap copies...

PS: with latest sphinx release my idle is 0.5