Xiaomi Router Memory Cleanup: A Complete Guide to All Models

The Internet slowed down, Xiaomi's router slowed down, and a warning appeared in the web interface about a memory shortage? These are typical symptoms of a crowded device storage. Unlike smartphones, where cleaning the cache is a routine procedure, routers are more complicated: there is no "Clear All" button, and improper actions can lead to loss of network settings or even a device blink.

In this article, we will analyze 7 working methods for cleaning memory on Xiaomi routers (including Mi Router models). 4A, 4C, 5, 6, AX3000, AX6000 You will learn how to delete temporary files, reset logs, optimize firmware and even return factory settings without losing performance.

Before you start cleaning, it’s important to understand what exactly is taking up your router’s memory. Unlike computers where programs and media are eating space, Xiaomi routers are clogged with memory:

  • πŸ“œ Log files of the system (logs of connections, errors, attacks)
  • πŸ”„ Firmware cache (temporary update files)
  • πŸ“‘ Guest network data (connection history)
  • πŸ”’ Firewall files (traffic filtering rules)
  • πŸ“¦ Residual settings after resetting

For example, the Xiaomi router AX3600 firmware MiWiFi_R3600 can accumulate up to 500 MB logs for six months of active use is almost half of the available 1 GB of memory! And it doesn't clean them automatically, which leads to lags and spontaneous reboots.

πŸ“Š What kind of Xiaomi router do you have?
Mi Router 4A/4C
Mi Router 5/6
AX1800/AX3000
AX6000/AX9000
Redmi Router
Other

1. Memory load check: where to watch?

Before you clean, you need to diagnose the problem. Xiaomi routers have two ways to check the memory:

  1. Through the web interface: Open your browser and enter 192.168.31.1 (or miwifi.com). log in (username and password from the sticker on the router). Go to State β†’ System (or Advanced) β†’ System Tools β†’ System Status for new firmware. Find the Memory Usage block).
  2. Through SSH (For advanced users: df -h The command will show the partitioning of memory. /overlay β€” This is the user section that is most often overflowing.

πŸ” What's normal? If less than 20 percent of the memory is free, it's time to clean it up. If it's less than 10 percent, the router can start to glitches (Wi-Fi falling off, Web interface slowing down).

Model routerTotal memory capacityCritical thresholdRecommended minimum
Mi Router 4A/4C256MB< 30MB50+ MB
Mi Router 5/6512MB< 60MB100+ MB
AX1800/AX30001GB< 100 MB200+ MB
AX6000/AX90002GB< 200 MB400+ MB

⚠️ Attention: On Xiaomi routers with firmware MiWiFi_RB03 (For example, Redmi Router AC2100) partitions of memory may not be displayed correctly. If the web interface shows 100% Downloads but the router is stable - check through SSH.

2. Cleaning log files: the most secure method

Log files are the router's main garbage collection, and they record everything that happens: device connections, errors. DHCP, Attempts to hack, firmware updates, which can eventually reach hundreds of megabytes, and you can delete them without risking the system, like cleaning a basket on a computer.

Method 1: Through the Web Interface

  1. Get in Advanced. β†’ System Tools β†’ System Log.
  2. Press the "Clear Log" button (or "Clear Journal").
  3. Confirm the action.

Method 2: Through SSH (cleaned)

rm -f /var/log/*


echo "" > /var/log/messages

Method 3: Automatic cleaning (for OpenWRT-based firmware):

crontab -e

Add a line for weekly cleaning (every Saturday at 3:00):



0 3   6 rm -f /var/log/* >/dev/null 2>&1

Make a backup copy of router settings|Record the current Wi-Fi settings (SSID password)|Disconnect important devices from the network during cleaning|Check the vacant space before and after cleaning-->

πŸ’‘ Why are logs growing so fast? Xiaomi routers have extended logging enabled by default for diagnostics (10+), journals may be filled in on 50-100 MB per month. You can turn off the detailed recording by the team:

uci set system.@system[0].log_size=64


uci commit




/etc/init.d/log restart

⚠️ Attention: On routers with firmware MiWiFi_R3G (Like Mi Router. 3G) manually cleaning the logs SSH This can cause the web interface to crash, in which case, use only the web method or reboot after cleaning.

3. Reset firmware cache and temporary files

Firmware cache and temporary files (/tmp) They accumulate after updates, plugins or failures. Cleaning them does not remove the settings, but can eliminate lags and errors such as "Inadequate memory for the operation".

Instructions for the web interface:

  1. Go to Advanced. β†’ System Tools β†’ Reboot.
  2. Select the option "Clear Cache and Reboot" (if any).
  3. Wait. 2-3 minutes - the router will restart with cleared cache.

Instructions for SSH:

rm -rf /tmp/*


rm -rf /var/lock/*




sync

πŸ”§ What else can you clean? /tmp frequently:

  • πŸ“ Session files (e.g. dhcp.leases)
  • πŸ”„ Remains of updates (folders like firmware_update)
  • πŸ“Š Traffic statistics (files *.db)

On routers with Padavan firmware (alternative), the cache is cleared automatically when you restart, but sometimes there are tails from plugins left to manually remove them:

find /tmp-name "*.ko" -delete # Removes downloadable kernel modules


find /tmp -name "*.ipk" -delete # Removes packet residues

πŸ’‘

If the router has become slower after cleaning the cache, check the QoS (Quality of Service) settings in the Advanced section. β†’ Bandwidth Control. Traffic priorities may have been reset.

4. Removal of guest network and connection history

Guest network and connected history take up to 100 MB of memory on Xiaomi routers with active use, which is not critical to work, but their accumulation can lead to errors such as β€œToo many devices connected” even with real number of devices within the norm.

How to clean:

  1. In the web interface go to Advanced β†’ Guest Network.
  2. Turn off the guest network (if not in use).
  3. Click on Clear Guest Devices (or Clear Guest List).
  4. For complete cleaning of connection history, perform through SSH: rm -f /var/dhcp.leases echo "" > /var/dhcp.leases

⚠️ Important: On Xiaomi routers with firmware MiWiFi_R4A (Like Mi Router. 4A Gigabit) cleaning the guest network can reset the main Wi-Fi settings. Write down before the procedure:

  • πŸ”‘ Name of the network (SSID)
  • πŸ” Password.
  • πŸ“‘ Channel and bandwidth

If the guest network is used regularly, set up autoclean through cron:

crontab -e

Clean up every Monday at 4:00.



0 4   1 rm -f /var/dhcp.leases_guest*

5. Firmware optimization: removing unnecessary packages

Xiaomi firmware often contains unnecessary components: plugins for IP-TV, Support for outdated protocols, demo services, which can be deleted by freeing up to 300 MB of memory, but beware, removing critical packets will cause the router to fail!

Safe list of packets to remove:

PackageDescriptionCan I remove it?Frees him.
minidlnaDLNA-media-streetYes (unless you use)~50MB
samba36-serverSMB-serverYes (if you don't need to)~80MB
pppoe-relayPPPoE Relays (for providers)No (may break the internet)β€”
luci-app-qosQoS (Traffic Control) interfaceYes (unless you use)~30MB

How to remove packages through SSH:

  1. Connect to the router via SSH.
  2. Check the list of installed packages: opkg list-installed
  3. Remove unnecessary package (e.g. minidlna): opkg remove minidlna --force-removal-of-dependent-packages
  4. Clean up dependent files: opkg autoremove

⚠️ Attention: On Xiaomi routers AX6000 and AX9000 Deleting wireless-tools or hostapd packets will result in Wi-Fi loss. Check dependencies with opkg dependant command before removing them].

How to recover a remote package?
If after removing the router stopped working correctly, connect to the cable and install the package back: opkg update opkg install [name packet] If there is no Internet - download the package to your computer from the OpenWRT site, download to the router via SCP (For example, WinSCP) and install manually: opkg install /tmp/[name file.ipk]

6. Complete reset (hard reset)

If previous methods didn't work, and if there's a critically low amount of free memory, it's going to be a hard reset, and it's going to bring the router back to factory settings, and it's going to delete all the data, including:

  • πŸ“‹ Wi-Fi settings (name, password, channel)
  • πŸ”Œ Port configuration and VLAN
  • πŸ”’ Firewall and Parental Control Rules
  • πŸ“Š Traffic statistics

How to make a hard reset:

  1. Press and hold the Reset button on the back of the router (10-15 seconds).
  2. Wait for all the indicators to flash (usually in orange).
  3. Release the button - the router will restart with factory settings.

πŸ”§ Alternative method through web interface:

  1. Get in Advanced. β†’ System Tools β†’ Backup & Restore.
  2. Press "Factory Default."
  3. Confirm the action and wait for the reboot.

⚠️ What to do after a reset?

  • πŸ”„ Update the firmware to the latest version (in Advanced) β†’ System Tools β†’ Upgrade).
  • πŸ”’ Change the Admin password (by default – admin).
  • πŸ“‘ Set up Wi-Fi again (name, password, channel).
  • πŸ›‘οΈ Turn on firewall and update safety rules.

πŸ’‘

Hard reset is a last resort.Be sure to save the settings to the file through Backup & Restore before resetting. β†’ Backup.The backup file can be downloaded back after the reset.

7. Alternative firmware: a radical solution

If the router is constantly clogging memory and standard methods are not helping, consider installing alternative firmware, such as OpenWRT or Padavan have more flexible memory management and automatic log cleanup.

The advantages of alternative firmware:

  • βœ… Automatic rotation of logs (does not accumulate for years).
  • βœ… Removing unnecessary services through the web interface.
  • βœ… Advanced cache settings (you can limit the size).
  • βœ… Support for external drives (USB-flash drive).

Cons:

  • ❌ Installation difficulty (risk of β€œbricking” router).
  • ❌ Loss of warranty (if router is guaranteed).
  • ❌ No official support from Xiaomi.

How to install OpenWRT on Xiaomi:

  1. Download the firmware for your model from the OpenWRT website.
  2. Connect to the router on SSH and do: cd /tmp wget [link to firmware] mtd -r write openwrt*.bin firmware
  3. Wait for the reboot (5-10 minute).

⚠️ Attention: On Xiaomi routers AX3600 And a newer installation of OpenWRT can lead to loss of support for Wi-Fi 6 due to closed drivers.

FAQ: Frequent questions about memory cleanup

πŸ”Ή Can you clean the memory of the Xiaomi router without resetting the settings?
Yes, in most cases, it is enough to clear the logs and cache (Sections 2 and 3 of this article), a full reset is required only when critical memory is filled or firmware failures.
πŸ”Ή Why is the memory refilled in a week?
This is typical of routers with extended logging enabled. SSH: uci set system.@system[0].log_type=0 uci commit Or set up automatic cleaning via cron (see section) 2).
πŸ”Ή How to clean memory on Xiaomi router via phone?
Use the official Mi WiFi app (available for the Android/iOS): Open the app and connect to the router. Go to Settings. β†’ Additionally. β†’ System tools. Select "Clear cache" or "Reset settings". πŸ“Œ Limitation: There is no access to log cleanup or packet deletion in the mobile app – only basic features.
πŸ”Ή What to do if the router does not turn on after cleaning?
This is a sign of firmware damage. Try: Hard reset: hold the Reset button. 30 seconds (to flash indicators) Recovery through TFTP: Connect the router to the computer via cable. Set up static on the PC. IP 192.168.1.2/24. Launch it. TFTP-server, tftpd64) and download the firmware with the.bin extension. Hold Reset when the router is turned on. 10 If nothing helps, contact the Xiaomi service center.
πŸ”Ή How to Prevent Memory Filling in the Future?
Follow these recommendations: πŸ”„ Turn off the guest network if you are not using it. πŸ“Š Set up automatic log cleanup via cron. πŸ”’ Update the firmware once in a while. 3-6 months (excluding memory bugs). πŸ“ Remove unnecessary packages (see section) 5). πŸ›‘οΈ Use light firmware (e.g. Lean's OpenWRT for weaker models).