yashsingh1/xdaforums huggingface dataset:
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Sultanxda:
Yeah, your original logs showed that you were using YouTube when the freeze occurred. Don't think I'll need any more logs for now. If my current tweaks work well with video streaming, I'll upload a new build in a few hours.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] kcc140:
Loving this kernel!
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Sultanxda:
New build is up with more Simple LMK fixes, hopefully for the last time.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] MrBrady:
Been playing see games. No lag!

Edit: spoke too soon. Not playing video, but just scrolling through YouTube caused some serious lag, resulting in SystemUI FC.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] lil_ith:
I'd recommend a clean install...when I first flashed the kernel update. I was getting some mad stuttering. But I fresh installed everything. It legitimately runs like a charm now. Could not be happier. Thankyou
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Sultanxda:
Ah, this is a regression. I fixed this in a previous version of Simple LMK but it seems I've reintroduced the issue in this release. It should be quite rare though.

I'll make a new build tomorrow which should have this fixed.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Sultanxda:
New build is up with the SystemUI crashes fixed. I really hope Simple LMK is a finished product now...
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] praveen6585:
the only thing 'simple' in Simple LMK is the name i think ;)
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Sultanxda:
To be fair, the concept that Simple LMK uses is really simple: when memory allocation fails because you've run out of memory, then kill processes until memory can be allocated again. But writing memory management code is hard, and there have been gotchas lying in wait at every corner...

Android's userspace LMK uses something called memory cgroups (<-- sounds complex), and Android's kernel LMK is super erratic in its behavior (it likes to go on killing sprees) since the mechanism it uses to decide when to kill processes is really vague in how it works.

Also, Simple LMK is only 300 lines of code. Not very complex for something so integral to the operation of your phone, eh?
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] praveen6585:
Thinking intuitively, shouldn't the straightforward logic be to kill apps that are the oldest? When a person is multitasking, he would mostly be switching between the last few apps that he opened - in which case the newest ones would be most relevant (unless he is switching between multiple huge games in which case it cannot keep everything in memory). This was the major issue that I (and probably many others) were facing on stock. Android sometimes stupidly decides to close the very last app opened before the current one which makes no sense whatsoever.

With 4 GB ram, I am assuming the system should be able to hold at least 4-5 basic apps in memory without issues but stock seems to fail to do that as well.

Also, does this mean that a 8 GB phone is actually better than a 4GB phone considering Androids erratic memory management? The probability of it going into panic is lesser i guess in that case
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] sublimaze:
I am no dev, but to me it makes the most sense to keep the newest and most frequently used apps in memory for as long as possible. For example, I never dismiss my text messaging app, email or web browser from the recents list.

This is one of the reasons why I have no interest in P3XL. Many new phones are coming with 6 GB memory....4 GB seems anemic for a 2018 flagship. If Android Pie is showing the weakness of P2XL memory management, imagine what the next version of Android will be like.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Hrithan2020:
I just flashed it over the Sep 8th kernel build (running Stock Android Pie September build), and for some reason, it is stuck in a bootloop.

1. I'm getting the "You device is corrupt. It can't be trusted and may not work properly......" warning.

2. After this, it goes to the standard bootloader unlocked warning and then the Google loading screen

3 .and immediately recycles to the same "Your device is corrupt" warning.

Anyone else having this issue?

Edit: Tried to go back to the Sep 8th build, and even factory reset in TWRP, but unfortunately getting the same issue now :(
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] praveen6585:
if you have anyway done a factory reset, why don't you fastboot flash the full factory image with wipe? that usually fixes any bootloop issue
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Hrithan2020:
Because that would wipe the internal storage as well, by default, where i will have to re-download a lot of data, and then spend a lot of time copying back contents. The non-internal storage wipe, for some reason in Pixel 2xl has been very iffy for me, dunno why.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] infamous84:
if you do it with the -w then it wont erase internal data, it will just be a dirty flash will all your stuff still intact.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Hrithan2020:
The non-internal storage wipe, for some reason in Pixel 2xl has been very iffy for me, dunno why.

When I flashed to pie, I first tried without data erase, but was getting frequent google crash issue, solved only by doing factory reset. I guess in this case, I'm screwed anyway, and will attempt the entire internal storage wipe. Will be careful from now on.

But, I take it none of you guys have the same issue as mine?
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] praveen6585:
Yeah.. I've been switching back and forth between Sultan and Flash and not faced this issue..
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] infamousvincci:
Been going back and fort to sultan and flash as well here. Not a single issue.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Hrithan2020:
Thanks, guys for confirming. May be a download issue. I will start from the beginning and give it a try then.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Reechings:
Unfortunately I have run into this issue trying to switch to sultan from flash for some reason. When I got the corrupt message thing, I switched slots using fastboot then went into TWRP and flashed flash kernel I was on previously and it came back up. This phone likes to mess with you sometimes.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] infamousvincci:
When u flash flash kernel, you dont have to flash magisk. On the other hand, when u flash sultan, u have to flash magisk after before rebooting.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Sultanxda:
No, the age of the process is not a good metric for deciding whether or not to kill it. What if I've been using Chrome for 3 hours and suddenly run out of memory? Chrome would get killed while I'm using it.

Android automatically assigns scores to different processes to determine how important they are to the system. The app that you have open right in front of you is always ranked as very important, while apps in the background are ranked as less important. Simple LMK goes through the different ranking levels of importance and kills the least important processes first, then moves onto higher-ranked processes if killing the unimportant ones doesn't free enough memory.

fastboot --set-active=other
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] praveen6585:
I think i framed my thought wrongly. By age of process, i meant ranking it in descending order of when it was last accessed. Any new app accessed would push the ranks of all other apps 1 rank down. Therefore anything running now is rank 1, second last app accessed (in terms of time) will be rank 2 and so on - therefore in your example, Chrome would not get killed. Probably the 5th or 6th last app that was opened would get flushed. I believe your definition of simple LMK sounds like it's doing something similar but not purely based on time but based on few other parameters to assign the importance. The only issue i see with Android deciding the importance is the diffrent usage patterns of everyone. For one individual, Instagram might be the most important process and for another it might be Chrome. Keeping it based on time alone will atleast reduce the newer apps from being killed just because android 'assumed' it was less important.

Another idea was the ability for the user to assign the importance. It need not necessarily be followed by the system but choosing an option to 'close last' for a few apps would flush the other apps out when needed.

In any case, the latest version seems to be working just fine. Not facing any issues with Youtube or multitasking.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] onliner:
Hi, first of all: thanks for your work with the new LMK, works amazing! Now I can keep up to 6-7 apps in memory without problems, but, just out of curiosity: this LMK can be "ported" to other devices? I'm new in the kernel department and I was wondering if I can include it in my other devices (One with 4.4, another with 3.18 and another with 3.10) without having problems during compilation or things like that.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Sultanxda:
The kernel doesn't have enough information to do what you're suggesting. The proper way to do what you're thinking of would be to alter the algorithm Android uses to rank program importance to take the last access time into account, though I'm sure Android already does this to an extent.

The importance of each process is constantly changing, and there

The patch probably won't apply cleanly but I think it'll compile fine on older kernels. However, I can't guarantee that the current version of Simple LMK is a finished product, so you should consider that before using it and possibly check for updates to it when they come.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] MrBrady:
Running well! Thanks for the update.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] moqwai.:
Had a system ui crash while browsing a text-file. Latest version. Do you need a logfile? If so, how can i get it?
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Donric13:
Thanks for your effort optimizing our device! Feeling some lag through browsing (brave) and opening links in Google app (webview) in latest release. Battery life seems great.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Sultanxda:
Did your phone freeze for a while first and then crash?

Search for "how to get a logcat" and follow some guide on XDA. Log messages disappear after a while though so there's a good chance that it's too late to collect a log now.

Yeah, I became aware of the minor bouts of lag as of a few hours ago. I know what the cause for them is (LMK is not being invoked frequently enough and the kernel is trying to free memory through other means).
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] moqwai.:
Yes, it froze, then crashed. Too late for log now, sorry
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] def-g:
Strange. I was going between this and Flash almost daily and never had an issue. I've been staying on this Kernel longer as I seem to get better reception in problem areas in my house.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Sultanxda:
Maybe it's because you're switching kernels frequently, which means you're rebooting all the time (which is an excellent way to avoid bugs).
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] def-g:
Had slight lag on 3.09 when web browsing. Went back to 3.08 and back to buttery Smooth.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Sultanxda:
Have you tried 3.09-This-Isn't-FlashKernel?
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] def-g:
Meant Sept.9 version. Told ya I switch lots. Gonna give Sept.10 ah go juss now.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] MrMagicPotato:
Can I use the latest version on 8.1.0 July? Or will I have problems or performance issues?
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] xFirefly93:
Only for 9.0/Pie.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] franciscofranco:
Sultan Karanal is lit.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] praveen6585:
[MENTION=4800121]Sultanxda[/MENTION] had another freeze with youtube around.. complete freeze with system ui closing.. log attached
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] sublimaze:
What other apps/games are you using when it freezes? Are you using a modded/themed YouTube app?

I haven't had any freezes on any Sultan kernel, and only one incident while on Flash Kernel 3.07 (the last Flash Kernel that I used).

I watch a fair amount of YouTube, but I am not seeing any FCs or other jank.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] MrBrady:
Yesterday I was running smooth for a few hours. Was listening to music and got an email. Clicked the heads up notification and music started stuttering, device hung, music stopped and after 3 minutes I decided to hard reboot.

No altered apps, not even Magisk installed.

Edit: I do keep a Samsung Gear S3 watch connected. That has lots of background apps running that do things when notifications come through
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] praveen6585:
I am using Vanced Youtube but it is more of how LMK is behaving when it runs out of memory than being app related. The trigger for low memory could be the app if it is hogging a lot of memory (and maybe Vanced Youtube is the culprit here) but LMK should be able to close stuff without crashing the whole system.

Also, my theory of Vanced not being an issue is based on the fact that I did not face this issue in Flash though I have been using Vanced since a really long time. Yeah, the stock memory management might have killed it before it got to a panic situation but I never had any System UI closures ever.

I am sure there are few more tweaks n tunings required for LMK to be more efficient.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] def-g:
I use Vanced regularly. I'm on Sultan September 8th. And have no issues. I did have problems with September 9th. Update.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] praveen6585:
I have had issues with every version of the kernel since LMK was built in. maybe im just unlucky.. lol

trying my best to help troubleshoot by providing logs so Sultan can find a fix.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] arh2o:
Yea I've noticed the freezes/hitches occur the most when rapidly switching apps. For example, launching Chrome, then quickly switching to Reddit, then quickly switching back to Chrome will sometimes freeze or hitch the phone for a couple seconds. It happens maybe 5% of the time? Maybe less, it's really hard to pin down.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] ShynizZ.:
lel, sorry but I flashed the kernel today on my freshly installed Android P and got some system UI crashes in a few hours only (big freeze during a couple of seconds)

Otherwise, it seems really fine! :svetius:

Thanks for your work :victory:
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Sultanxda:
Try this kernel: View attachment Sultan-kernel-wahoo_20180912-lmktest1.zip
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] piyush7243:
Trying it now
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Donric13:
Thanks for test kernel. Using it since an hour. First impressions very good. Snappy and no lags in browsing and scrolling so far. Gonna report if this changes.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] kerymercury:
This one is great. No more lag or panic freeze. Been using for the last couple of hours
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] ShynizZ.:
Pure awesomeness
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] def-g:
Been testing from this morning. Feels EXTRA SNAPPY. No lag. So far so good.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Reechings:
So far so good and thank you so much for adding the extra vibration percentage options!
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] JeromeLeung:
Not sure if it's related, but Android Auto stopped working for me on the test kernel.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] praveen6585:
new test kernel is working fine so far. youtube is behaving itself and overall operation is also snappy
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Sultanxda:
Try this kernel: View attachment Sultan-kernel-wahoo-20180914-lmktest2.zip
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] def-g:
You still got Westwood in these test builds Sultan?
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] ShynizZ.:
This kernel is unreal ? I got no issues at all with this version
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] infamousvincci:
Anyone tried this kernel on nitorgen os if it runs?

Thank you!
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] :
Yes.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] moqwai.:
Hickups again with latest testkernel. Version before was good (12th)
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Reechings:
Tried the second to last test version on it and had lag happening.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] infamousvincci:
Thanks mate.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] def-g:
No issues here. Stock with Latest MAGISK. Super fast.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Donric13:
Can confirm lags in scrolling (mainly Google app). Test1 running perfect on my device (stock with Magisk 17.1).
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] praveen6585:
Lmk test 1 was snappier.. noticed a few slow downs in test 2
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Sultanxda:
Try this kernel:

EDIT: Nevermind, that kernel sucked.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Sultanxda:
Try this kernel: View attachment Sultan-kernel-wahoo-20180915-lmktest4.zip
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] lil_ith:
I just tried this. I had some run downs on previous ones in certain UI elements. Some not in the version 1 that was released on the first. So far I have not experienced any on this one. So far!! Thanks sultan
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Donric13:
So far no lags on test4 while browsing or on Google app. Fast and snappy. Gonna report if something changes. Thanks for new test.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] moqwai.:
Test4 with hickups and freezes. Not as severe as test2, but test1 still the best
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] praveen6585:
Had a freeze when using Chrome.. log attached

Any reason why you were unhappy with test 1 or want me to look for something specific in that? It seems to work without issues for most testers and i keep going back to that kernel always
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Sultanxda:
Round 5: View attachment Sultan-kernel-wahoo-20180917-lmktest5.zip
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] :
Out of curiosity, are you tuning the values for LMK or changing the logic behind it in the test kernels?
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] moqwai.:
Same. Hickups and freezes
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Sultanxda:
Mostly changing logic. Values didn't seem to have much of an impact across all of the tests.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] praveen6585:
Giving honest feedback but this one seems to be much worse than the others.. logs attached.. pretty much everything became sluggish at the end and continued that way till i restarted
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Vinnipinni:
Hey Sultan! Something is off. Haven't used your kernel for a while, but I remember it being great. First hour of using it was just awful. Apps taking a long time to open, freezing often and stuff. Just wanted to get that out here. If it gets better I'm coming back, but for now, I'm gonna stick to stock. I'm sure you're gonna fix it though. Good Luck!
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] sublimaze:
Try lmktest1.zip from page 45. I have been using it since release and no lag, jank or FCs so far. Great battery life too.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Sultanxda:
Try today's build. The lag is caused by Simple LMK, which isn't finished yet, so I've removed it for now.

lmktest1 was kinda hacky, but since it's the only one that worked, I'm guessing it was a step in the right direction.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Sultanxda:
I've removed Simple LMK for now, but I'll keep posting test builds in here for it. I think it'll be finished in a few weeks to a month.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Vinnipinni:
Works way better. Thanks!
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] def-g:
Very interesting. I've used all the Test builds(on 4 now) and haven't had 1 freeze or hickup. Whether Browsing or Watching Vanced YouTube or having 5+ apps open and switching between them. Test build 4 is crazy snappy. Lucky me I guess.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Sultanxda:
That's because you reboot and switch kernels before you can really run out of memory
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] def-g:
Lol. Actually I've stuck on your Kernel the last week. Shocking I know. I seem to get better reception in some problem areas in my house. Go figure.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Sultanxda:
[MENTION=2787004]praveen6585[/MENTION] Here's another Simple LMK test:

EDIT: Newer test uploaded
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] torhect:
Does RAM management problem get solved with this kernel?
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Sultanxda:
Well, if you test it then maybe we'll know...
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] torhect:
I mean I asked it because im thinking to switch from s8 plus to this phone but I have seen some videos on YouTube that this phone even though has a Google stock light android software is suffering from bad ram management! And thats something for me is important as im a heavy app user and playing games! But i know with a script a kernel and build prop tweaks mayor this problem can be solved right?
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] def-g:
Test build working well. Super fast and Smooth. Have nuff things opened: Vanced, Browser, WhatsApp, Textra. Switching between no issues. Don't game so can't test that.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Sultanxda:
[MENTION=6147829]Donric13[/MENTION] [MENTION=8683967]lil_ith[/MENTION] [MENTION=2409277]moqwai.[/MENTION] [MENTION=2787004]praveen6585[/MENTION] New Simple LMK test:

EDIT: New test here: https://xdaforums.com/showpost.php?p=77756830&postcount=489
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] praveen6585:
Will test this today evening once I'm back home.. im using the script by [MENTION=8852292]xFirefly93[/MENTION] .. that wouldn't affect the testing bit right? I mean the script wouldn't override any changes uve made?
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Sultanxda:
I'd prefer that you have the same setup as you did when you last tested Simple LMK and ran into issues, just to be safe.

Also, I've attached a new test kernel to this post since I've confirmed that the previous one was bad.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] praveen6585:
Running on stock without any scripts. Will report back if i come across issues.

Edit: first crash using Facebook. App stopped working and nova launcher crashed as well. Log attached
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Sultanxda:
No need to test Simple LMK anymore because it works now (I promise)! Last night I found the missing link causing all the freezes.

Enjoy the new LMK.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Reechings:
So download link points to the fixed one?
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Sultanxda:
Yes. The download link in the first post points to the latest version.