Cache Cleanup on Xiaomi Mi 9: A Complete Guide to Speeding Up Your Phone

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 typeWhere it's storedWhen to cleanRisks in cleaning
Cash app./data/data//cacheEvery 1-2 months or with app glitchesWhen you first start the application will load longer
System cache/cache (section cache)After MIUI updates or when interface lagsSome system services may be affected
Dalvik cache/data/dalvik-cacheOnly in case of serious lag or after manual firmware updateThe 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 often do you clean your Xiaomi cache?
Once a week.
Once a month
Only when the phone starts to brake
Never cleaned.
I don't know what that is.

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.

  1. Open Settings → Applications → Application Management.
  2. In the upper right corner, click on three dots and select Show All Apps (important! otherwise some system applications will be hidden).
  3. Find the app you want (like Facebook) and tap it.
  4. 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:

  1. Open the Security app (shield icon).
  2. Go to the "Optimization" tab.
  3. Click “Clean up” → select “App Cache”.
  4. 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)

  1. Turn off Mi 9.
  2. Press Volume Up + Power before the Mi logo appears.
  3. In the menu, select the language (if you have a choice), then:
  4. Go to "Wipe & Reset» → «Wipe Cache».
  5. Confirm the action and wait for the completion.
  6. 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:

  1. Install ADB/Fastboot Tools on PC.
  2. Connect the Mi 9 to your computer in Fastboot mode (clip Volume Down + Power).
  3. In the command line, do:
fastboot erase cache


fastboot reboot

This command completely clears the /cache partition. If the phone doesn't reboot, do:

fastboot continue
What if the phone does not turn on after cleaning the cache?
If the Mi 9 is stuck on the Mi logo after cleaning the cache, try: 1. Go to the recavator (Loudness up + Power) and select "Wipe Data" (full reset). 2. If it doesn't help, swipe the phone through the Mi Flash Tool with a choice of "Clean All" option. 3. For custom firmware, restore the backup via TWRP.

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:

  1. Download Mi 9 to TWRP (Loudness Up + Power).
  2. Go to Advanced» → «Wipe Dalvik Cache».
  3. Swipe for confirmation.
  4. 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"

  1. Open "Security» → «Optimization».
  2. Put it on the gear in the top right corner.
  3. 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:

  1. Go to Settings → Applications → Memory Protection.
  2. Select “High Protection” (restricts cache for rarely used applications).
  3. 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:

  1. Open the phone app.
  2. Enter the code: ##4636###.
  3. 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.

FAQ: Frequent questions about cleaning the cache on Xiaomi Mi 9

❓ Do I need to clean the cache if the phone is working properly?
No, unless the Mi 9 is slowing down and there is enough free memory (at least 2-3 GB), no cache cleaning is required. The system cache helps to speed up the re-launch of applications.
❓ Why After Cleaning the Cache, Some Apps Stopped Working?
This happens if you have cleared the app data (not just the cache), for example, chats on WhatsApp or Telegram may disappear. To avoid this, only clear the cache, not the entire memory of the application. If the data is already lost, restore it from the backup (if you have one).
❓ Can I clear the cache without losing data?
Yes, cleaning the app cache or system cache (/cache) does not affect user data (photos, contacts, messages).The exception is cleaning the Dalvik cache, which may cause some applications to crash but will not delete your files.
❓ How often should you clean the cache on Xiaomi Mi 9?
Recommended frequency: 📱 Cache of applications: once every 1-2 months or when lags appear. 🔧 System cache: once every 6 months or after updates MIUI. 🛠️ Dalvik cache: only for serious problems (for example, after manual firmware updates).
❓ What to do if after cleaning the cache the phone began to warm up?
This is normal: after cleaning the Dalvik cache or system cache, the Mi 9 reassembles files, which loads the processor. Give the phone 10-15 minutes to calm down. If the heat doesn't go away: Close all background apps. Turn off mobile data/Wi-Fi for 5 minutes. Check the temperature in Security → Optimization → Temperature. If above 45°C, restart the phone.