yashsingh1/xdaforums huggingface dataset:
[Samsung Galaxy S8 & S8+ Cross Device Development] ace2nutzer:
Nothing to do with them.

After you boot with the new flag exynos-m2, just run:

logcat | grep "exynos-m2"

if you see errors, then it's not supported and exynos-m1 should be used.

btw: i've checked your logs, yes there's is still memory allocation issues.

It's like OOM when the memory pressure is very high.

I didn't check so far the other logs from other users, but i guess it's the same.

Edit: checked your build.prop from pop.zip, it's right.
[Samsung Galaxy S8 & S8+ Cross Device Development] Ryujin96:
Okay so far everything is right. I got no reboot in 24 hour usage with everything on default with a twrp and kernel reflash. I just did btw the command for checking if exynos-m2 is supported and it doesnt return anything, it means then is supported or did i something wrong? @ace2nutzer
[Samsung Galaxy S8 & S8+ Cross Device Development] Ryujin96:
Oh i see why, system reverts exynos-m2 back to exynos-m1 when reboot after editting build.prop
[Samsung Galaxy S8 & S8+ Cross Device Development] ace2nutzer:
Then you didn't save the file.

Reboot to twrp

and do the job with (ADB) nano:

nano /system/build.prop

Make sure /system is mounted (checked).
[Samsung Galaxy S8 & S8+ Cross Device Development] Ryujin96:
Well i did it with build.prop edittor, i saved becus i checked it afterwards and the changes were saved, but when i reboot for to push the new build.prop changes trough something reverts it back. I read magisk prevents it and you need to manually changes the build.prop in magisk /sbin/.magisk/mirror/system build.prop .but while i changed it i got a softbrick with it and needed to reflash my rom and kernel and magisk. So i put something wrong in the build.prop or both files were different from eachother that causes it. @ace2nutzer
[Samsung Galaxy S8 & S8+ Cross Device Development] ace2nutzer:
Nothing to do with Magisk, /system partition is mounted read-only.

In recovery you can edit everything with nano text editor directly in the phone. Or if you are not familiar with nano you could also use adb pull, edit with any linux distro or in Windows edit with proper Notepad++, and then adb push back to the phone .. but again, only in recovery.
[Samsung Galaxy S8 & S8+ Cross Device Development] Ryujin96:
Got it, i saved it in internal storage and then copying it to /system partition with twrp file manager. Changes stays now.
[Samsung Galaxy S8 & S8+ Cross Device Development] ace2nutzer:
OK that works as well, but you need to check if the permissions are now still right. It should be root : root 644 or -rw-r--r--.
[Samsung Galaxy S8 & S8+ Cross Device Development] Ryujin96:
Okay, just 644? Becus its 4 digit. Btw is this the right order in the build.prop for the dalvik vm section? When i added the lines under the line dalvik.vm.heaptargetutilization=0.5

And got after that i got stuck on the samsung loading logo so i looked the order up and it should be like this?

dalvik.vm.heapstartsize=8m

dalvik.vm.heapgrowthlimit=256m

dalvik.vm.heapsize=512m

dalvik.vm.heaptargetutilization=0.5

dalvik.vm.heapminfree=2m dalvik.vm.heapmaxfree=8m
[Samsung Galaxy S8 & S8+ Cross Device Development] ace2nutzer:
yes, or 0644.

It doesn't matter.

but that's wrong:

dalvik.vm.heapminfree=2m dalvik.vm.heapmaxfree=8m

and that's right:

dalvik.vm.heapminfree=2m
dalvik.vm.heapmaxfree=8m

Also you may need to wipe dalvik after changing the heap flags.
[Samsung Galaxy S8 & S8+ Cross Device Development] Ryujin96:
Okay, i had them under eachother not side eachother, the cause of the problem was the heapgrowthlimit and heaptargetutilization, after i changed those to 192m and 0.75 it worked again, but i have copied back the old build.prop because it has the recommend things in it already for this kernel, but i know now what i have to change if i got those weird ram management glitches again, take tomorrow again a look in to it if it is indeed the missing lines that causes it. For now im good, besides the OOM issue with zram 60% or higher.
[Samsung Galaxy S8 & S8+ Cross Device Development] ace2nutzer:
You will face higher battery draining with less heap 192m and 0.75. I suggest to revert to 256 and 0.5.
[Samsung Galaxy S8 & S8+ Cross Device Development] rtyuakatsuki:
Random reboot when after call someone on whatsapp

Setting All default

Twrp from you

Magisk 23.0

I follow all Installation instruction

Change build.prop like what you say and other stuff may you can check it dev
[Samsung Galaxy S8 & S8+ Cross Device Development] ace2nutzer:
Thanks, that should be enough.

@rtyuakatsuki ​

was it a soft-reboot i guess ?

Next time please generate immediately logcat & dmesg for soft reboot without extra rebooting ! - That should be more useful for soft-reboots !

btw: i've some great news:

1. reduced the price for the full version to 4 €. (since this phone is now old)

2. updated post #1 - 3. (cleanup, fixed grammar and optimized for darkmode)

3. uploaded a few new screenshots to post #1 - SOT, benchmark scores when OC at Max possible with 95 °C Max CPU / GPU Temp, etc ...
[Samsung Galaxy S8 & S8+ Cross Device Development] MUNISH MONGA:
@ace2nutzer

Is there any su command to keep an app always in RAM, and prevent it from being killed by LMK?
[Samsung Galaxy S8 & S8+ Cross Device Development] pranil60:
while charging soft reboot

tweaks: LMK-192

Big CPU: 2.496

GPU: 572

Zram: 90%

First time in two days when I switched Zram to 90%
[Samsung Galaxy S8 & S8+ Cross Device Development] Ryujin96:
i know, but i mean with my previous message that i use the build.prop it came with the rom, so it havent those line it was recommend to remove with this kernel thus the already optimized one not the one i was editting.
[Samsung Galaxy S8 & S8+ Cross Device Development] ace2nutzer:
Maybe yes, google it, i don't have it in my mind right now.

Thanks, next time for soft reboot generate logcat & dmesg without to reboot. That's more useful. I've checked your log but it's quite impossible to find the right thing on a 2 MB text file.

I don't think so, a2n installer script removed those lines automatically.

But it looks like it wasn't a good idea and therefore on next release i'll suggest to readd them, unfortunately you will have to readd them by hand.

For instance, those are the heap values from the latest stock ROM:

dalvik.vm.heapstartsize=8m

dalvik.vm.heapgrowthlimit=256m

dalvik.vm.heapsize=512m

dalvik.vm.heaptargetutilization=0.75

dalvik.vm.heapminfree=2m

dalvik.vm.heapmaxfree=8m

There are already good, i would only change

dalvik.vm.heaptargetutilization=0.75

dalvik.vm.heapminfree=2m

to

dalvik.vm.heaptargetutilization=0.5

dalvik.vm.heapminfree=4m

probably for better RAM usage. (taken from latest AOSP sources)

Those heap flags has also nothing to do with the ROM itself, but with the available device RAM and screen resolution.
[Samsung Galaxy S8 & S8+ Cross Device Development] Ryujin96:
Okay, well ill readdem them when i have time.
[Samsung Galaxy S8 & S8+ Cross Device Development] ace2nutzer:
OK, i've checked all the logs, it's still the same bug.

You don't need to report further issues regarding reboots.
[Samsung Galaxy S8 & S8+ Cross Device Development] Ryujin96:
Its something with the RAM in combination with zram, every option else than zram off causes a crash, probably OOM issue. But running it without zram its stable.
[Samsung Galaxy S8 & S8+ Cross Device Development] ace2nutzer:
Yes, good idea, try for now with zRam 0 % if it's stable.

There is something wrong with the virtual memory.

Not an real issue with physical RAM.

Basically OOM, but virtual.
[Samsung Galaxy S8 & S8+ Cross Device Development] Besdensaa:
I added these lines to build.prop and I set the permissions on 644

dalvik.vm.heapstartsize=8m

dalvik.vm.heapminfree=4m

dalvik.vm.heapmaxfree=8m

And I have not had a random reboot since

I'm using Devbase ROM

Thanks dev
[Samsung Galaxy S8 & S8+ Cross Device Development] Adbnpk2013:
So after thorough testing i think i might have narrowed the reboots problem. According to my testings , whenever i change zram with reboot option i experience random reboots ( 2-3 per day. But whenever i change the zram no metter to which option (0,30,60 or 90% ) without rebooting the phone ( the option where zram changing takes upto 8mins) , i never experience any random reboots. Its my 3rd day consecutively without any random reboots after changing the zram without rebooting the phone.

I am no expert how it works but i think the random reboots might be related to zram changing method.

@dev what are your thoughts about it ?
[Samsung Galaxy S8 & S8+ Cross Device Development] pranil60:
oops.. so I have to reboot again after soft reboot? I'll upload logcat next time for sure.. it must be pain in the head to search 2mb file of text.. sorry for that
[Samsung Galaxy S8 & S8+ Cross Device Development] pranil60:
I actually agreed with you... cause when I used init.d to change zram with execution it took time to change zram.. but I didn't got reboot but I realising it now as you mentioned it clicked me nice observation..
[Samsung Galaxy S8 & S8+ Cross Device Development] madhatter57:
i have been using 3.5 with latest twrp from you with zero bugs apart from the rare occasion of random reboot, my only hope is that battery life would improve more in the new version but i haven't seen that; i have also experienced excess heating in new version and phone being prevented to go into deep sleep with forcedoze app... i am not very advanced user just would like to be able to use my phone reliably in the wilderness with long battery life :)

about the other managers: a2n full version is fine, but it is missing the ability to apply settings on boot and changing profiles and settings while offline, which for me honestly feels like very basic things... even though i understand why you wouldn't want to implement them, it is still inconvenient for me.

thanks for the amazing work nevertheless
[Samsung Galaxy S8 & S8+ Cross Device Development] ace2nutzer:
@ up

I try to revert to auto apply settings on boot.

As for offline app usage: you only need to keep it in RAM, just press home button instead to tap the back key. That way you can use the app the whole day without internet.

@ all

here we go again :D We don't give up !

Uploaded a pre-release kernel:

S8

S8+

Please test stability.

Note: in case of soft-reboot, just report without logs.

Otherwise, if a hard random reboot happened, then post please last_kmsg.

zRam 30 % by default, but you can change it with latest a2n app or over init.d. Full version app is fully working on this pre-release.

Pre-Changelog:

fixed moisture detection hacks - should fix wired headphone bug

zRam improvements

LPM charger upgrade:

set battery Max charging Temp to 45 °C and increased wireless charger current 1000 mA @ 1500 mA.

Pro tip:

to improve speed even more, (faster app start-time) add / update your dalvik heap flags like this:

dalvik.vm.heapstartsize=16m
dalvik.vm.heapgrowthlimit=256m
dalvik.vm.heapsize=512m
dalvik.vm.heaptargetutilization=0.5
dalvik.vm.heapminfree=8m
dalvik.vm.heapmaxfree=32m

taken from Google AOSP upstream.

As you can see, it's stated for a 6 GB RAM phone, but it's still compatible with our 4 GB RAM phone since Samsung stock ROM default heapsize is also 512 MB.

Tested and works very well.
[Samsung Galaxy S8 & S8+ Cross Device Development] Ryujin96:
Great ill test it out. Do we need to flash a new compiled twrp from your ftp with the new kernel or is the old one fine?
[Samsung Galaxy S8 & S8+ Cross Device Development] ace2nutzer:
The old one is still ok, because no changes in RAM console.
[Samsung Galaxy S8 & S8+ Cross Device Development] Ryujin96:
Alright, i added the dalvik vm values back in my build prop and it works now. Found out that the build prop editor put the values like next eachother and not in lines that causes problems in my build prop and that causes problems while starting up. My bad lol
[Samsung Galaxy S8 & S8+ Cross Device Development] Ryujin96:
@ace2nutzer Is it normal when wiping dalvik/cache the device is rlly slow?
[Samsung Galaxy S8 & S8+ Cross Device Development] ace2nutzer:
Yes and after 3 days it'll be very fast and battery as well more optimized.
[Samsung Galaxy S8 & S8+ Cross Device Development] Ryujin96:
Okay great, ill see what the performance is after 3 days
[Samsung Galaxy S8 & S8+ Cross Device Development] rtyuakatsuki:
Hi dev i got reboot when scrool home menu after use whatsapp

Diffrent reboot and soft reboot is

the reboot from logo when first turn on phone right?

And soft reboot is start direct to samsung logo right ?

I forget it dev hehe

May you can check my log maybe found useful think
[Samsung Galaxy S8 & S8+ Cross Device Development] Ryujin96:
@ace2nutzer i got again the same multitasking issue i got a while back, like foreground apps closing down when enter an other app when multitasking.

Lmk default

Zram 0%

Buildprop dalvik vm

dalvik.vm.heapstartsize=16m

dalvik.vm.heapgrowthlimit=256m

dalvik.vm.heapsize=512m

dalvik.vm.heaptargetutilization=0.5

dalvik.vm.heapminfree=8m

dalvik.vm.heapmaxfree=32m
[Samsung Galaxy S8 & S8+ Cross Device Development] madhatter57:
thanks, here's a suggestion then, in case you want to keep the same license check pattern: include toggle for offline mode in app or

include a way to hide it from recents menu (that way when clearing all apps from recents it will stay running). i personally have the habit of tapping the clear all button to free ram and keep phone tidy.
[Samsung Galaxy S8 & S8+ Cross Device Development] ace2nutzer:
Kernel version ?

Actually i only need reports from the pre-release build.

With zRam 0 % is normal. Use at least 30 or even better 60 %.

Or maybe related to the bigger heaps ? You could try 4, 8, 16m instead 8,16,32m.
[Samsung Galaxy S8 & S8+ Cross Device Development] rtyuakatsuki:
Ouh ya i forgot mention it the version pre release
[Samsung Galaxy S8 & S8+ Cross Device Development] ace2nutzer:
Soft reboot is: you see directly the Samsung logo and it doesn't ask for SIM PIN. For this sort of reboot you don't need to post logs, just report.

Tried many times, but so far i couldn't find the right place in logs what happens right before the reset.

While for real reboots it's easy to find.

But i'm sure it's the same bug, once the hard random reboots is fixed, it should fix soft resets as well i think.

I'll upload new test kernel in around 1-2 h.
[Samsung Galaxy S8 & S8+ Cross Device Development] Ryujin96:
@ace2nutzer Okay, i tried it with every combination with the build.prop, even removing some lines till i have this in my build.prop.

dalvik.vm.heapgrowthlimit=256m

dalvik.vm.heapsize=512m

dalvik.vm.heaptargetutilization=0.5

It closes still the foreground app, mainly when i open the xda app it closes whatsapp chrome and the buildprop edittor app after 2-5 sec after i opened the xda app and looking on the threads and switching back to one of other the apps. Also tried with zram on or changing the lmk size.
[Samsung Galaxy S8 & S8+ Cross Device Development] Ryujin96:
Okay i fixed it with a dalvik wipe, it close sometimes still the apps in combination with xda app but its not as much as first.

Zram 30%

Lmk 192mb

Dalvik buildprop values

dalvik.vm.heapstartsize=8m

dalvik.vm.heapgrowthlimit=256m

dalvik.vm.heapsize=512m

dalvik.vm.heaptargetutilization=0.5

dalvik.vm.heapminfree=4m

dalvik.vm.heapmaxfree=16m

I'll let it run with zram 30% enabled, hopefully no random reboots for 24 hours.
[Samsung Galaxy S8 & S8+ Cross Device Development] ace2nutzer:
As for the multitasking issue, try this:

in init.d:

echo 32 > /sys/block/sda/queue/read_ahead_kb
echo 32 > /sys/block/sdb/queue/read_ahead_kb
echo 32 > /sys/block/sdc/queue/read_ahead_kb
echo 32 > /sys/block/sdd/queue/read_ahead_kb

Uninstall a2n full version app for this test. (to apply above settings earlier)

Then edit zRam script: (system/etc/A2N...)

and uncomment "#echo 32 > /sys/block/zram$i/queue/read_ahead_kb" at the end of the file.

Save and reboot.
[Samsung Galaxy S8 & S8+ Cross Device Development] Ryujin96:
@ace2nutzer Do i need to execute those init.d commands in terminal emulator or do i need to editting the 99_user init.d script? I already editted the zram script.

And do i need to install it again after reboot? Or just leaving it how it is?
[Samsung Galaxy S8 & S8+ Cross Device Development] rostifaner:
@ace2nutzer reboot again with prerelease version
[Samsung Galaxy S8 & S8+ Cross Device Development] ace2nutzer:
Add the commands in 99_user.

Those changes are permanent as long as you don't flash new kernel.

It's only for this test kernel, later once we get good config, you don't need to modify those things anymore in future builds.
[Samsung Galaxy S8 & S8+ Cross Device Development] Ryujin96:
It looks like its working now. I can hold apps open till the zram is fully filled and when opening one app thats requesting memory when none is available in zram it kills some apps to free up some memory. But im doing now some stability testing.
[Samsung Galaxy S8 & S8+ Cross Device Development] ace2nutzer:
So it makes a big difference with read_ahead_kb 32 for multitasking ??
[Samsung Galaxy S8 & S8+ Cross Device Development] Ryujin96:
For me yes, but guess its an good idea to let more ppl test it out with it to be sure if it is for everyone a good fix.
[Samsung Galaxy S8 & S8+ Cross Device Development] ace2nutzer:
For instance in 29.10.2021 build it's at 32 kb.

So if you had no multitasking issues with 29.10., then i'll readd those optimizations. Without this change, read_ahead_kb runs at linux default which is 128 or 256 kb (depending on LK version) that probably is a waste of RAM and therefore i had set it to 32 kb. But probably it increases I/O speed if it's bigger than 32 kb.
[Samsung Galaxy S8 & S8+ Cross Device Development] Ryujin96:
True, it increases the I/O performance speed a bit because it its uses like as an cache. I did it once for my internal & external storage, it increases a bit of performance but for storage its for me not rlly worth it. But for the zram its a bit noticible with reopening a foreground app, its bit faster than without it.
[Samsung Galaxy S8 & S8+ Cross Device Development] Ryujin96:
@ace2nutzer found btw something accidentally about optimizing boot times, dont know if its worth it and usefull.

Optimize boot times | Android Open Source Project

source.android.com
[Samsung Galaxy S8 & S8+ Cross Device Development] ace2nutzer:
Was it with zram 0 % ?

Yeah i'm aware of this page. IMHO it's too much RAM wasting.

512 kb is probably good for rotational HDDs, but not for flash storages.

I think we'll stay with 32 kb.
[Samsung Galaxy S8 & S8+ Cross Device Development] rtyuakatsuki:
Zram default dev 30% cause that enough for me
[Samsung Galaxy S8 & S8+ Cross Device Development] white5pirit:
USB seems funky with this one.

Windows can't find the proper driver and says the USB device is not recognized.
[Samsung Galaxy S8 & S8+ Cross Device Development] ace2nutzer:
Try this one:

Pre-release 17.11:

S8

S8+

Recommended dalvik-heap:

dalvik.vm.heapstartsize=8m
dalvik.vm.heapgrowthlimit=256m
dalvik.vm.heapsize=768m
dalvik.vm.heaptargetutilization=0.5
dalvik.vm.heapminfree=4m
dalvik.vm.heapmaxfree=8m
[Samsung Galaxy S8 & S8+ Cross Device Development] Ryujin96:
Great, i'll flash the new pre release soon. Btw pro tip for everyone, dont reboot when changing zram size just wait till it is resized and loaded, you can use the app "ram truth" to check it. When the zram is finished and enabled, it shouldnt give a random reboot. It works for me and maybe for others.
[Samsung Galaxy S8 & S8+ Cross Device Development] ace2nutzer:
No need to use another app for this.

The A2N app shows a dialog once the new size is ready.
[Samsung Galaxy S8 & S8+ Cross Device Development] Ryujin96:
@ace2nutzer guestion, what does the swappiness setting do? Searched it for info but still dont understand it.
[Samsung Galaxy S8 & S8+ Cross Device Development] white5pirit:
That seems to have worked (I only had a few minutes to test, but for now it has yet to reboot when unplugging the USB cable/changing USB settings) 👀 Thank you so much!!
[Samsung Galaxy S8 & S8+ Cross Device Development] ace2nutzer:
Read the text from a2n app, what you don't understand ?
[Samsung Galaxy S8 & S8+ Cross Device Development] Ryujin96:
@ace2nutzer I undersrand that part but not what it does rlly. On some sources it says its a sort of threshold for kicking in swap for how much % ram you have used and when swap should kick in. Dont know if it is right?

Btw, got just again that random memory management app glitching for a sec.
[Samsung Galaxy S8 & S8+ Cross Device Development] ace2nutzer:
Swappiness documentation

@Ryujin96

But we use 100 - 200.

Because values < 100 will not work properly on Android.

100 will swap to zram both files taken from flash memory and the cache data produced by an app.

At 200 only pure app cache will be swapped to zram.

That means you could use the whole RAM with just one app, then once RAM is full and zram is still free and you try to load a new file or new app, it'll kill something in RAM imstead to swap to zram. While at 100 you never will face issues as long as zram has some free space.
[Samsung Galaxy S8 & S8+ Cross Device Development] Ryujin96:
Okay clear for me
[Samsung Galaxy S8 & S8+ Cross Device Development] ace2nutzer:
Someone is testing test kernel 17.11 ?

I hope it's stable so far.

So far no issues for me.
[Samsung Galaxy S8 & S8+ Cross Device Development] Ryujin96:
Testing it also, so far no problems also, but gonna switch zram to 90% becus that was the least stable for me everytime.
[Samsung Galaxy S8 & S8+ Cross Device Development] ace2nutzer:
Yeah, for now it's better to try to stress the RAM as much as possible. Choose a zram size that was most unstable.

We are not trying to find a most stable config. It's kernel bug and you can't fix it in userspace. Once it's fixed you can use every zram size 0 - 100 % and keeping the phone online for 1 month without reboots. This is how it should be. Switched also to 90 % zram size.
[Samsung Galaxy S8 & S8+ Cross Device Development] Ryujin96:
@ace2nutzer still having multitask issues, it closes down apps 2/3 times from foreground when fast switching back/forward between them even slowly it happens 2/3 times.

Apps combo used for testing:

Xda app, instagram, facebook, facebook messenger, twitch, youtube vanced, google translate, adobe reader, discord, titanium backup, google Chrome, gmail,whatsapp, ram truth.

Zram: 90%

Lmk: 64mb

Used zram:1500mb

Buildprop:

dalvik.vm.heapstartsize=8m

dalvik.vm.heapgrowthlimit=256m

dalvik.vm.heapsize=768m

dalvik.vm.heaptargetutilization=0.5

dalvik.vm.heapminfree=4m

dalvik.vm.heapmaxfree=8m

Still testing the zram stability, so far its stable.
[Samsung Galaxy S8 & S8+ Cross Device Development] ace2nutzer:
Looks all right and with swappiness 100 you shouldn't have problems.

Try to wipe apps cache and then once again dalvik cache, even if it sucks.
[Samsung Galaxy S8 & S8+ Cross Device Development] Ryujin96:
Okay i'll try that and try again with the same setup.
[Samsung Galaxy S8 & S8+ Cross Device Development] Ryujin96:
@ace2nutzer Seems to fix it. Got 13 apps open in foreground switching back and forth with the same app setup and a2n app setup and buildprop setup as first, instead of the xda app i have some lighter apps like samsung message and phone app also on foreground.

Zram usage 2700 - 3000mb

Still stable as a rock.
[Samsung Galaxy S8 & S8+ Cross Device Development] white5pirit:
The fingerprint reader takes a while to unlock the phone when the screen is off.

If I wake the device so the screen turns on but it's still locked then unlock it with my fingerprint itt unlocks a lot faster. Is this a kernel thing or ROM thing?

I'm using the 17.11 kernel preview.
[Samsung Galaxy S8 & S8+ Cross Device Development] Ryujin96:
@ace2nutzer the last buildprop recommendation you gave, it has the best battery life with it or slightly worse than the past ones? Becus it can be my phone usage from yesterday it uses 60% in 1of 2 hour time but i dont know, thought with a past buildprop config i had a better batterylife but im not rlly sure about it.