Xiaomi Mi 9 is still a popular smartphone thanks to the powerful hardware and flexible firmware MIUI. However, over time, even flagship devices begin to “brake”: applications open for a long time, the system hangs, and free memory is catastrophically lacking. 90% of the time the blame is clogged cache that accumulates over the years. This article is not about banal resetting settings, but about spot cache cleaning without loss of data, taking into account the features of the Mi 9 (code name cepheus) and current versions of MIUI 14/15.
We will discuss all types of cache, from the user cache (which can be deleted in two clicks) to the hidden Dalvik cache, which affects the speed of application launch. We will separately dwell on the nuances: why after cleaning the cache Mi 9 can work slower for the first 5-10 minutes, how to avoid the error "android.process.media stopped", and what to do if the system does not allow you to delete the cache of a particular application. Spiler: ADB and hidden engineering menus will come in handy.
Why Xiaomi Mi 9 cache should be cleaned regularly
Cache is a temporary file that is created to speed up the system and applications. On the Mi 9 with its Snapdragon 855 and 6/8 GB of RAM, cache plays a critical role: it reduces the load on the processor and saves battery power. But over time, these files turn from assistants to enemies:
- 📉 Slowing down: App cache can take up to 5-10 GB (check Settings) → Storage? When memory is scarce, MIUI Begins to “hang” when multitasking.
- 🔄 Errors and outages: A damaged cache causes Android.process.acore or com.android.phone to crash – a typical problem on the Mi 9 after updates.
- 📱 Overheating: clogged Dalvik cache makes the processor work at its limit, especially when running "heavy" games (Genshin Impact, Call of Duty Mobile).
- 🔋 Fast battery discharge: background processes continually reassemble the cache if it is damaged, which eats up to 15-20% of the charge per night.
The Xiaomi Mi 9 has three types of cache that require cleaning:
| Cache type | Where it's stored | When to clean | Risks in cleaning |
|---|---|---|---|
| Cash app. | /data/data//cache | Every 1-2 months or with app glitches | When you first start the application will load longer |
| System cache | /cache (section cache) | After MIUI updates or when interface lags | Some system services may be affected |
| Dalvik cache | /data/dalvik-cache | Only in case of serious lag or after manual firmware update | The first launch of any application will be slow (recompilation) |
⚠️ Note: If you use the Mi 9 with custom firmware (like Pixel Experience or LineageOS), cleaning the Dalvik cache may result in a bootloop (on loop). TWRP.
How to Clean the App Cache on Xiaomi Mi 9
This is the safest and fastest way to free up space. On the Mi 9 with MIUI 12-15, there are two options: through system settings or using the built-in Optimization tool.
Method 1: through application settings
Suitable if you need to clear the cache of a particular application (such as Telegram, Instagram or Google Play Services) that has started to glittle.
- Open Settings → Applications → Application Management.
- In the upper right corner, click on three dots and select Show All Apps (important! otherwise some system applications will be hidden).
- Find the app you want (like Facebook) and tap it.
- Select "Storage» → «Clear the cache».
System applications (e.g. com.android.systemui) may require unlocking developer rights:
Settings → About the phone → MIUI version (shap 7 times)
Settings → Additional → For developers → Enable “Allow system settings to change”Method 2: Mass Cleaning through Optimization
If you need to quickly clear the cache of all applications at once:
- Open the Security app (shield icon).
- Go to the "Optimization" tab.
- Click “Clean up” → select “App Cache”.
- Slip "Clean" and confirm the action.
On the Mi 9 with MIUI 14+, this method cleans up to 1-3 GB of garbage at a time. However, it does not affect the system cache and Dalvik.
Close all background apps (especially messengers)
Connect your phone to charge (the process can take 5-10 minutes)
Back up important data (some apps will reset)
Check the space (needs at least 1 GB to reassemble the cache)-->
⚠️ Warning: After mass cache cleaning, Mi 9 can temporarily "sweeten" - this is normal. The system recovers necessary files!
Cleaning the system cache (section /cache)
The system cache stores temporary update files, logs and recovery data. On the Xiaomi Mi 9, cleaning it helps solve problems with:
- 🔄 Fixed Updates ("System Update" hangs at 0%).
- 📱 Black screen after rebooting.
- 🔊 Missing sound in the speaker (audio.hal error).
There are two ways to clean up: through the recovery (without data loss) and through the Fastboot (requires an unlocked bootloader).
Method 1: through standard recovery (no root)
- Turn off Mi 9.
- Press Volume Up + Power before the Mi logo appears.
- In the menu, select the language (if you have a choice), then:
- Go to "Wipe & Reset» → «Wipe Cache».
- Confirm the action and wait for the completion.
- Reboot your phone (Reboot → System)
This method is secure and does not affect user data, but only clears /cache, not /data/dalvik-cache.
Method 2: via Fastboot (for power users)
If standard recovery doesn’t help (e.g., the E:unknown command error), use Fastboot:
- Install ADB/Fastboot Tools on PC.
- Connect the Mi 9 to your computer in Fastboot mode (clip Volume Down + Power).
- In the command line, do:
fastboot erase cache
fastboot rebootThis command completely clears the /cache partition. If the phone doesn't reboot, do:
fastboot continueWhat if the phone does not turn on after cleaning the cache?
Cleaning Dalvik cache: when you need it and how to do it
Dalvik cache is an optimized file for the ART virtual machine (Android Runtime) that speeds up the launch of applications. On the Xiaomi Mi 9, it is stored in /data/dalvik-cache and can take up to 500 MB-1 GB.
- 🛠️ After manual firmware update (to avoid errors "App not installed»).
- 🐢 With extremely slow phone operation (lags when opening any applications).
- 🔄 After changing the custom firmware (for example, with the MIUI on AOSP).
⚠️ Important: Cleaning the Dalvik cache causes all applications to be compiled anew when they first run, which can take up to 10-15 minutes and heat up the phone.
How to Clear Dalvik Cache with TWRP
This method requires TWRP Recovery installed:
- Download Mi 9 to TWRP (Loudness Up + Power).
- Go to Advanced» → «Wipe Dalvik Cache».
- Swipe for confirmation.
- After cleaning, reboot to the system.
If you don’t have TWRP but have root rights, you can clear the cache through ADB:
adb shell
su
rm -rf /data/dalvik-cache/*
reboot💡
If the phone is loading for a long time after cleaning the Dalvik cache, don't panic. Wait 15-20 minutes - the system recovers files. Don't turn off the Mi 9 and don't remove the battery!
Automatic cache cleaning: MIUI settings
MIUI has built-in tools for automatic cache cleaning, but by default they work inefficiently. On Xiaomi Mi 9, you can configure autocleaning so that it does not interfere with work, but also does not allow memory to fill.
Setting up "Optimization"
- Open "Security» → «Optimization».
- Put it on the gear in the top right corner.
- Turn on the options: 🔄 «Autocleaning (set a schedule, for example, once a week). 📁 «Screen lock cleaning” (removes background app cache). 🚫 «Restriction of background processes” (reduces the load on RAM).
Setting up "Memory Protection"
This function prevents memory from being filled with cache:
- Go to Settings → Applications → Memory Protection.
- Select “High Protection” (restricts cache for rarely used applications).
- Add frequently used apps (e.g. WhatsApp, Banking Apps) to the exceptions.
2. Cleaning through the engineering menu
On the Xiaomi Mi 9, there is a hidden diagnostic menu where you can reset some types of cache:
- Open the phone app.
- Enter the code: ##4636###.
- Go to Battery Information → Statistics Reset (this will clear the cache of energy consumption data).
To reset the cache of the network (useful for problems with the mobile Internet):
##7262626## → Field Test → Wipe Cache⚠️ Warning: Do not change other settings in the engineering menu unless you know their purpose! Incorrect settings can lead to network loss or overheating of the processor.