yashsingh1/xdaforums huggingface dataset:
[Nexus 7 (2013) Android Development] retiredtab:
I should mention that I and a few others have seen the above memory leaks when there 100+ of the above orphaned/zombied processes on other devices. This usually takes 2 to 3 weeks before the device slows down. My example above shows only 2, but we've seen 100+.

This seems to happen when you open the browser, then close it manually. Then you open, close, open, close, open, close, etc. Each time you close the browser, it leaves behind the __skb_recv_datagram b1fccc10 S com.brave.browser_zygote (50MB). On DRAM limited devices, it doesn't take long to consume all the memory.

The problem only seemed to start with 19.1 and higher. It does NOT happen with 18.1. As many know, LineageOS dropped a lot of "legacy devices" starting with 19.1 due to lack of eBPF support in the older 3.x kernels.

I and others have NOT seen this problem with "OFFICIAL" supported 20 LineageOS builds like my SM-T290. On my SM-T290, there is no leftover zygote process when I close the browser.

This is why I ask people to show the output of the above command.

We have NOT seen this on Firefox based browsers. The built in Webview browser engine into LineageOS also does NOT have this problem.
[Nexus 7 (2013) Android Development] osm0sis:
Thanks for the insights! I'll try to remember to check tonight next week when I get some time if it seems like it's already acting up since my last reboot a few days ago. 🙌

I do have Chrome installed, but I generally avoid opening it because I know it's such a hog. The freeze-ups and force closes seem to occur whether I've opened Chrome or not in a given uptime.
[Nexus 7 (2013) Android Development] retiredtab:
I can't be sure, but if you set Chrome to be your default browser, it's possible that an app uses Chrome as the browser to fetch whatever information that it needs (i.e. opening Chrome in the background -> invisible to you). That would explain all the instances of the com.android.chrome_zygote.

It took me months of troubleshooting to find out the above. Yes, killing all those processes frees up the memory and everything should be responsive again.

Options.

1. Use a Firefox based browser.

2. Use DuckDuckGo which uses the built in process webview.

3. Uninstall all Chromium android based browsers.

4. Use some app that has root privileges to automatically kill those com.android.chrome_zygote automatically every 24 hours.
[Nexus 7 (2013) Android Development] osm0sis:
I suppose Lineage's System Webview could be starting those processes somehow, but the crazy thing is I don't have Google's Android System Webview and Chrome isn't even a system app since I'm using the NikGApps Go arm package. I wonder if adding on the Google arm Webview and Trichrome library might fix it.. 🤔

And yep I was thinking about a simple cron.d, but of course Tasker or Automate would do the trick. Perhaps not having it as the default browser or something to restrict its background processes could be an option as well!
[Nexus 7 (2013) Android Development] retiredtab:
Here's my stats. I have NO gapps or Chromium based browsers. I use DuckDuckGo.

flo:/ # uptime
19:07:29 up 16 days, 2:25, 0 users, load average: 8.46, 9.40, 9.65
flo:/ # ps -A | grep zygote
root 301 1 1733452 37576 poll_schedule_timeout b00e1238 S zygote
webview_zygote 868 301 1674620 20220 poll_schedule_timeout b00e1238 S webview_zygote
flo:/ # free -m
total used free shared buffers
Mem: 1803 1590 213 7 96
-/+ buffers/cache: 1493 310
Swap: 511 149 362

I enabled zram on mine and I have no slowdowns.
[Nexus 7 (2013) Android Development] osm0sis:
Well of course you don't! 😛
[Nexus 7 (2013) Android Development] osm0sis:
Tried making Chrome a system app but that made no difference, at least not on my dirty install, so I landed on the following workaround, which needs to go into service.d so as to be non-blocking:

/data/adb/service.d/000killchromezygote:

#!/system/bin/sh
# 000killchromezygote
# by osm0sis & retiredtab @ xda-developers

# work around chrome_zygote zombie processes causing OOM on older devices
while sleep 3600; do
killall com.android.chrome_zygote;
done;
[Nexus 7 (2013) Android Development] retiredtab:
I made an updated 20 build with the May 5th 2024 security patches based on followmsi's repos. In addition, I modified the DRM code as it was failing some of the DRM tests with one of the DRM info apps I used to check.

If people had problems with $treaming services in the past, my build might solve those problems? I don't have these services so I cannot verify myself.

In addition, I enabled zram.

Release notes

NOTE: All builds that I upload have been personally tested on my device to boot. Having said that, there's still a chance it won't work on your device due to human error, your configuration, your apps, etc. If it won't boot, always start with a complete wipe of everything and format your data in TWRP. This is known has a clean install. Backup your data before a clean install.

May 14, 2024

1. Incorporates May 5th security patches as per https://review.lineageos.org/q/topic:"T_asb_2024-05"

2. Possibly fixed DRM for some $treaming servces and enabled zram.

All changes documented at

https://github.com/followmsi/androi...iredtab:android_device_asus_flo:los-20.0-test

https://github.com/followmsi/androi...etiredtab:android_vendor:flo-deb-lineage-20.0

You can download from

https://sourceforge.net/projects/retiredtab/files/Nexus 7 2013/20/

3. You should be able to dirty flash from followmsi's 20 builds, but as always, I recommend you backup your data in case something goes wrong and you need to clean install everything (including format data in TWRP).
[Nexus 7 (2013) Android Development] MVelte:
Dirty flash worked like a charm. It feels snappier, maybe due to the enablement of zram.
[Nexus 7 (2013) Android Development] clarkgable:
I agree, it definitely feels snappier.
[Nexus 7 (2013) Android Development] osm0sis:
The real question is whether it will choke the CPU/IO and kill battery life; that's the trade-off with ZRAM. I think @followmsi had ZRAM enabled in a previous build but ended up removing it again. IO seems like the definite bottleneck on this device where my switching scheduler to noop improved things. Is the scheduler still noop on the new build? 😯🤔
[Nexus 7 (2013) Android Development] retiredtab:
I've had the Nexus 7 2013 for a long time (bought used), but never really used/use it. So I don't know the entire history about zram even though I'vde made the effort to read most of the posts here re zram (via search).

I did research what's on gerrit and found this for 15.1

https://review.lineageos.org/c/LineageOS/android_device_asus_flo/+/210632

HOWEVER, flox 18.1 "official" has zram enabled as per

https://review.lineageos.org/c/LineageOS/android_device_asus_flox/+/363184

and even set it to 75% as per

https://review.lineageos.org/c/LineageOS/android_device_asus_flox/+/365499

However, I think when I checked 18.1, the above commit was broken and non working? I can't remember for sure and regardless, I'm staying on 20 (I eat my own cooking).

For those who want to remove zram from my build, do the following:

1. Boot into TWRP.
2. Touch mount system (to mount /system as read/write).
3. Edit the file system/vendor/etc/fstab.flo and place the character "#" in front on the last line where the zram entry is.
example
# open a terminal/command prompt on your PC
adb shell
# use the built in vi editor
vi system/vendor/etc/fstab.flo
# put the "# character in front of /dev/block/zram0
# /dev/block/zram0
# save file
# reboot into OS
# Zram should be disabled now

The above needs to be done for each new release I make in the future. That is, if I make a June 5th security patch, you will need to repeat the steps above to remove the zram.

I didn't change anything with followmsi's code with respect to the i/o scheduler. That is, it's still noop as per

https://github.com/followmsi/androi.../configs/lineageos_flo_defconfig#L37C1-L37C22

I also used devcheck by flar2 to verify that i/o is noop. CPU governor is ondemand.
[Nexus 7 (2013) Android Development] retiredtab:
Perhaps the root cause of everyone's slowdown is due to zombie/orphan zygote processes and NOT zram? When doing research on the devices I build, it started with LineageOS 19.1 and exists in 20.0. It does NOT happen with 18.1

However, since LineageOS dropped support for 19.1 on our "legacy" devices as per https://lineageos.org/Sunsetting-LineageOS-18.1/ , I suspect we're missing a commit(s) or patch(es) that kills the zygote processes OR our "legacy" code doesn't implement some new feature that properly kills the zygote?

I don't think I'll ever find the code to fix it, but at least it's documented and there's a workaround (kill the processes manually or use a script) or simply reboot the device once a week.

Many Android browser apps use the Chromium code as their base and I suspect 85% of the users here fall into that category whether they know it or not.
[Nexus 7 (2013) Android Development] prsa01:
Thanks much for picking up the baton on this! I look forward to giving it a try in the next day or 2.
[Nexus 7 (2013) Android Development] prsa01:
Dirty flashed and seemed to work great. Retained Magisk root.

Thanks again for this!
[Nexus 7 (2013) Android Development] prsa01:
Only negative I've found in quite limited use is when seeking/repositioning within a video in a chromium browser it rarely will resume playing. Haven't tried clearing cache or anything else yet.

Any ideas?
[Nexus 7 (2013) Android Development] osm0sis:
Working great! Way more stable at boot completed. :D

Any chance you could do a user build instead of userdebug, and a private release-keys signed build instead of test-keys? That now appears to be needed to pass with latest Play Integrity changes. :o
[Nexus 7 (2013) Android Development] retiredtab:
I have no plans to make an user build for the following reasons:

1. I find userdebug a good option since I'm the one who is making changes to the roms I maintain. So having the ability to run adb logcat at boot time and change /system to read/write (/system is read only by default and for security purposes) for troubleshooting purposes is invaluable to me. When adb logcat doesn't work, it's almost IMPOSSIBLE to troubleshoot.

In addition, I have a slow compiler computer and changing from userdebug to eng and vice versa often involves several hours of recompilation even if I don't change a single line of code. I suspect it might be the same switching between userdebug and user.

2. Signing the build involves more passwords and private keys and while I have a password manager to keep track of all this, it's not something I want to deal with. My password manager sits on one very secure separate computer that I ONLY use for critical tasks. I have other computers that I use for general day to day usage and one computer set aside for compiling.

I provide the sha256sum with all my builds if people are worried about the zip file being tampered with.

3. I haven't used gapps since Nov 2021 and have no plans to play any cat and mouse game with "device is certified" + hacks to get play integrity to pass.

4. The rom is currently selinux permissive. BEFORE I released the May build, I tried to enforce it and updated the selinux rules, but I cannot get bluetooth to work if I enforce it. Again, I don't use gapps, but in the past, having selinux enforcing, I thought was necessary in order to pass Safetynet? Wouldn't it be the same for play integrity?

5. Since I was able to compile 20 using followmsi sources, anyone who wants to make an user build and sign it with private keys is free to do so.
[Nexus 7 (2013) Android Development] osm0sis:
Currently we just hide the SELinux status and that bypasses the checks and PI/SN would pass, but that changed 2 days ago and they no longer allow any ROM signed with testkeys. If you could at least find your way to signing a build with something other than testkeys at some point that would probably be all we actually need... All official custom ROMs that aren't using private release-keys yet will be switching to do so soon for this reason.

(Remember PI restricts what can be installed from the Play Store, so it's not just about payments.)

Thanks for your consideration!
[Nexus 7 (2013) Android Development] retiredtab:
If you want to change testkey, see this post #80 and my reply at #81

https://xdaforums.com/t/unofficial-...t710-mar-12-2024.4430339/page-4#post-88276525
[Nexus 7 (2013) Android Development] osm0sis:
Sorry, please see my edits. It's not about the props, it's about the actual release-keys signature of the ROM build. That's what PI/SN is checking now. It needs to be signed with a private key, similar to how Lineage official does it.

Edit: Basically if you type unzip -l /system/etc/security/otacerts.zip and it shows testkey then PI/SN will fail.
[Nexus 7 (2013) Android Development] Stettin:
Bumping this as I've seen no reply. Has anyone successfully installed 20.0 with MindTheGapps-13.0.0-arm-XXXXXXXXXXXXXXXXXX? If so please let me know which exact builds you used.
[Nexus 7 (2013) Android Development] osm0sis:
If you use my flo2flox zip in the latest TWRP I seem to recall that all MTG zips flash normally afterwards, so possibly try that? It's in the old official flo TWRP thread, linked in my signature.
[Nexus 7 (2013) Android Development] Stettin:
I'm still stuck, I tried installing and I get some weird errors

Checking device...

flo

Installing...

/dev/block/platform/msm_sdcc.1/by-name/recovery

Unpacking ramdisk failed. Aborting...

Updater process ended with ERROR: 1

Error isntalling zip file '/sdcard/N7-13_TWRP_flo2flox#############

Updating partition details....

...done

Any ideas?

I tried wiping, reloading recovery, and doing it again. At some point i started getting something like can't find "/vendor" or something. I also tried to run the repartition again and it failed. Somehow I got back to a bootable state with Lineage 20, but I still can't seem to get gapps :(
[Nexus 7 (2013) Android Development] osm0sis:
Had you repartitioned? Were you on the latest official TWRP?
[Nexus 7 (2013) Android Development] Stettin:
I used twrp-3.7.0_9-1-flo_followmsi.img from the google drive link in this post and sysrepart_1380_20.zip

Is there a way to make sure the partitioning went through correctly? I assumed since I could install LineageOS 20 that it worked.
[Nexus 7 (2013) Android Development] Stettin:
I found another thread that recommended BitGapps and it worked for me without any further modifications.

[GUIDE/TUTORIAL/HOWTO] Google Nexus 7 2013 Stock to Android 13

[GUIDE/TUTORIAL/HOWTO] Google Nexus 7 2013 Stock to Android 13 [GUIDE/TUTORIAL/HOWTO] Google Nexus 7 2013 LTE/deb or Wi-Fi-only/flo to Android 13 / LineageOS 20 in 2024 This detailed step-by-step guide helps you transform your Google Nexus 7 (4G...

xdaforums.com

The link to the BitGapps was broken, so I did a google search and found them. I used - BiTGApps-arm-13.0.0-v3.4-CORE.zip - flashed successfully from twrp-3.7.0_9-1-flo_followmsi.img
[Nexus 7 (2013) Android Development] TheHitMan:
BiTGApps now hosted on a dedicated server.

BiTGApps

Google Apps Package

bitgapps.io
[Nexus 7 (2013) Android Development] theistus:
Wow, nice work man. Up and running on my Flo with mindthegapps and magisk stable 27. Flashing my Deb next!
[Nexus 7 (2013) Android Development] Stettin:
Would you mind posting the filename and/or link you used for mindthegapps? I was never able to use those when I updated my flo.
[Nexus 7 (2013) Android Development] theistus:
I just used the one in FollowMSI's google folder. But note, you MUST reformat using the 1480 zip file that was linked in the original post to have enough space to do that though. Just flash it in TWRP and follow the instructions it gives (disable MTP, run it from the temp folder, yadda yadda, just follow the instructions it gives you in TWRP).

If you don't want to go to the effort maybe try the bitgaps linked above with the 1380_20 flash reformat script in FollowMSI's google drive. I haven't used it, but the bitgaps package appears to be much smaller in size.
[Nexus 7 (2013) Android Development] Stettin:
OK, I definitely did not use the 1480 when I prepped the device, just the 1380_20. I didn't see 1480 recommended in this thread at that time. I really only needed google play services and play store on, so the minimal bitgapps did the trick for me.
[Nexus 7 (2013) Android Development] taw62:
Having installed the latest build more than a month ago, it's still running smoothly. @retiredtab: thanks!
[Nexus 7 (2013) Android Development] TomL2:
Any chance you could build this for deb?
[Nexus 7 (2013) Android Development] followmsi:
You are welcome .. ;)
[Nexus 7 (2013) Android Development] kioshi:
How do I donate to you?? My Nexus 7 runs every night thanks to your addition to this rom.

Can I buy you a burger at least?
[Nexus 7 (2013) Android Development] followmsi:
Thanks .. I just do this for fun .. no need for any donations. :)
[Nexus 7 (2013) Android Development] drewski_1:
Glad you got it sorted. :good:

What was done to resolve the issue?

Or is Open GApps now fixed for clean install?
[Nexus 7 (2013) Android Development] Sib64:
Just a complete clean flash or factory reset (system - data - dalvik and cache) and done finally.
[Nexus 7 (2013) Android Development] followmsi:
Sounds interesting .. opengapps setupwizard is working again ?

Do we have more volunteers for a clean install ? ;)

EDIT: just from yesterday .. https://xdaforums.com/showpost.php?p=72125765&postcount=4294
[Nexus 7 (2013) Android Development] Sib64:
Yes no problem for me.

My process :

Clean install

Flash rom and SuperSu

Reboot system

Flash micro OpenGapps

Wipe cache and dalvik

Reboot system and all is good.... ?.... For my N7 LTE ?
[Nexus 7 (2013) Android Development] followmsi:
Ok .. you skip the setupwizard as you boot into system first.

Thanks fo the update!
[Nexus 7 (2013) Android Development] boom1982:
[MENTION=5480152]followmsi[/MENTION]

Hi

Tell me, f2fs support data/cash or only cash?
[Nexus 7 (2013) Android Development] followmsi:
Both .. data and cache !

But not cash .. just kidding ;)
[Nexus 7 (2013) Android Development] boom1982:
Okay)

When installing, I used glitch kernel, Because was not sure of the support :)

Here still used elemental x stock kernel ?
[Nexus 7 (2013) Android Development] followmsi:
Yes, EX 6.07 is used for this ROM now.

You can use any kernel you like .. check for f2fs support before, if required.
[Nexus 7 (2013) Android Development] STMSHD37:
I flashed "[7.1.2_r8_N2G47O] [2017-05-02]" yesterday and encountered "buggy setup wizard" but

I have the memo how to skip it which I found in somewhere (sorry I forgot), it was succeeded to

launch Android system properly. My Nexus7 has no problem at this point but if I find any problems,

I will report you here. Thanks.;)
[Nexus 7 (2013) Android Development] boom1982:
Good rom

Only missing battery percentages and sync icon(in quick setting)

[MENTION=5480152]followmsi[/MENTION]

Is the boost L2 cache enabled (in stock kernel)?

I always turn this setting off

fiops 512 - Not the best option :)
[Nexus 7 (2013) Android Development] followmsi:
percentage will be shown if you charge - this can be changed.

Inside System UI tuner.

http://www.pocket-lint.com/news/135...ry-percentage-on-your-android-7-nougat-device

Not sure regarding the sync icon .. have a google search yourself :)

What about L2 cache ?

Fiops 512 ?

Sorry, we are using EX kernel here ... stock values from EX kernel without using EX manager.

Pls install EX manager and change kernel settings you like.

Hope this helps ..
[Nexus 7 (2013) Android Development] boom1982:
[MENTION=5480152]followmsi[/MENTION]

Now I realized how bad my English is))

Maybe me should use my native language here?)))
[Nexus 7 (2013) Android Development] followmsi:
We can understand you .. but as more information as better.

Hope all your issues are more clear now.

Cheers
[Nexus 7 (2013) Android Development] boom1982:
[MENTION=5480152]followmsi[/MENTION]

Sync icon (In the lower right corner)

http://www.picshare.ru/view/8070048/

Percentage of battery in system ui - Too small, it is no good at all :)

I just wanted to know - Will always be clean aosp Or are planned pleasant little things, like battery percent, sync icon and advanced boot menu)
[Nexus 7 (2013) Android Development] followmsi:
Clean AOSP only - nothing more !
[Nexus 7 (2013) Android Development] boom1982:
Thank you for your answers, jokes and patience.

I can imagine how much time you spent on this job...Not getting "cash", except as f2fs:)
[Nexus 7 (2013) Android Development] boom1982:
[MENTION=5480152]followmsi[/MENTION]

Does the kernel initially support f2fs date / cache?

Or did you add a patch?
[Nexus 7 (2013) Android Development] followmsi:
The EX kernel does support F2FS .. nothing to be done.

Just changed fstab accordingly.
[Nexus 7 (2013) Android Development] boom1982:
When the cache f2fs - the speed of backups and the installation of updates noticeably increases)
[Nexus 7 (2013) Android Development] TheDigitalSlacker:
Sadly I am getting the setup wizard keeps stopping error. I've formatted every partition, redownloaded opengapps (both micro and pico) and redownloaded the rom. Not sure what to do about it now.
[Nexus 7 (2013) Android Development] STMSHD37:
You may find the solution at:

https://xdaforums.com/showpost.php?p=71804860&postcount=281
[Nexus 7 (2013) Android Development] Sib64:
HI,

Just used my process which skip the setup wizard as I boot into system first.

My process :

Clean install

Flash rom and SuperSu

Reboot system

Flash micro OpenGapps

Wipe cache and dalvik

Reboot system and all is good.... ?.... For my N7 LTE ?
[Nexus 7 (2013) Android Development] TheDigitalSlacker:
Yep, had to boot into system without gapps to bypass the setup. Annoying that you can't have it restore apps from the wizard but i guess a fresh system isn't a bad thing. thank you both!
[Nexus 7 (2013) Android Development] STMSHD37:
You're welcome!
[Nexus 7 (2013) Android Development] drewski_1:
from other posts, it looks like Beans GApps' Setup Wizard works, if you want to restore from Google.

please search first. all of this has been discussed.
[Nexus 7 (2013) Android Development] followmsi:
It never stops until the setupwizard is working again .. :)

Maybe I will make a package to replace opengapps setupwizard with this one ..

https://github.com/beanstown106/DynamicGapps/tree/n/files/system/priv-app/SetupWizard

But this is not the real solution .. it has to be fixed at the source of the problem !
[Nexus 7 (2013) Android Development] followmsi:
Still made a quick package now .. :)

AOSP_7.1.2_Flo-Deb_BeansGapps_SetupWizard.zip

To be installed after opengapps installation !

I did test the installation but actually not the SetupWizard itself.

Pls test and report if its working this way ..

Cheers
[Nexus 7 (2013) Android Development] busdonic:
Setup wizard FC for me, on the BeansGapp zip above.

Only thing that has worked recently is to restore my last backup and dirty flash latest ROM. The stand-alone BeansGapp zip files dont' work for me either, but not at the initial setup. Mine does the eternal "checking for updates" and never budges.

Thanks followmsi for your work.