[Xiaomi Mi Mix 3 ROMs, Kernels, Recoveries, & Other] ritchie888:
After spending many hours flashing and reflashing my global Mi Mix 3 I believe I've got it in a state where the memory leak is gone. Flashing any Chinese dev or stable MIUI ROM (I tried perseus_images_9.3.28_20190328.0000.00_9.0_cn and perseus_images_V10.3.1.0.PEECNXM_20190330.0000.00_9.0_cn) would boot to that ROM, but flashing Pixel Experience over the top always resulted in a boot loop. I'm sure many other global Mix 3 owners will attest that 9 out of 10 methods of flashing PE posted here don't work unless you have the Chinese version of the phone.

The steps I used are below, however, I can't say with any certainty if the numerous flashes before my working method had any any effect on the working solution. My solution assumes you already have an unlocked bootloader and have TWRP recovery flashed. The TLDR of it all is that flashing the global ROM using the Xiaomi flash tool, as opposed to TWRP, I am assuming was the key solution (again, I cannot be sure) as everything else is very similar to [MENTION=3516101]homer.ali[/MENTION] method (which did work for me, however, resulted in the memory leak issue). I am going heavy on the detail so if anyone wants to try my method with exactly the same versions of software you can. All software can be found by Googling the version numbers I provide.

1) Clear everything in TWRP. Under 'wipe', swipe to factory reset, then go to 'advanced wipe', tick every box and swipe to wipe, then go to format data, type 'yes' and swipe to wipe. Many, if not most of these steps, are probably unnecessary, but I wanted to be certain that I have a clean slate.

2) Go to 'reboot' and reboot to recovery. This should rebuild the file system into a state ready for flashing after we deleted everything in step 1.

3) Go to 'reboot' and reboot to bootloader. This will put the phone in the state ready for flashing.

4) On your computer, connect the phone via USB and open Xiaomi Mi Flash tool (I used version Miflash_20185280)

5) Your phone should appear in the list of devices, if it doesn't make sure you're in bootloader and click refresh. Also make sure you have the appropriate drivers, if you don't you should be able to install them by going to 'driver' in the file menu then clicking install. Might need to reboot your computer and/or phone and reopen the Miflash software.

6) Download the Xiaomi base ROM to your computer and load it by clicking 'select' and navigate to the folder. It must contain 'flash_*.bat' files. I used perseus_global_images_V10.2.2.0.PEEMIXM_20190228.0000.00_9.0_global. I have attempted to use numerous other ROMs from an assortment of sources, but never had the same result as using this ROM.

7) IMPORTANT, at the bottom of the flashing tool, click 'clean all' instead of 'clean all and lock'. If you don't do this you'll relock the bootloader and will have to unlock it again (not really an issue, you can do it really fast and with minimal effort, but worth avoiding if you can!)

8) Flash the ROM by clicking 'flash'. It'll take somewhere around 180-200something seconds to complete. Once it completes it'll reboot and load into the ROM, leave it to do it's thing until it's done.

9) If I am remembering correctly, it'll overwrite the recovery software to the default Xiaomi recovery. Overwrite this with TWRP again by restarting the phone into bootloader (power and volume down), and using fastboot to flash TWRP. I used twrp-3.2.3-0-perseus but I don't think it matters what version. If TWRP is already installed post-Xiaomi ROM flash you can ignore this step.

10) With TWRP installed, reboot into recovery by holding power and volume up. In some scenarios the Xiaomi ROM can overwrite TWRP with it's own recovery. If it does this just follow step 9 again.

11) Flash pixel experience (I used version PixelExperience_perseus-9.0-20190216-0408-UNOFFICIAL). Go to 'install' select the ROM and install.

12) Clear cache/davlik once it finishes.

13) Flash Magisk (I used version Magisk-v19.0, although I believe version 17.3 should also work).

14) Clear cache/davlik.

15) Reboot to system and wait until PE appears.

Upon trying this method I no longer have a memory leak after 24 hours. As mentioned in a previous post of mine, I discovered that the phone lock was the cause of the leak. I tried the phone for 24 hours without any lock, with zero leak. Then 24 hours with just the pattern lock, no leak. Now I'm going on 50+ hours with a pattern lock and finger print registered with (as far as I can tell) also no leak. At the absolute maximum the RAM usage has gotten as low as 1.9 GB free (out of 5.5 which can be used). Also in a previous post of mine you'll see I had issues with national roaming, meaning I had to apply a fix so that data would work in my country. This (for reasons I haven't worked out) is also not a problem anymore, as data worked immediately once following the method above, with no need to apply my fix.

Happy to answer any questions anyone may have.