How to fasten an app to Xiaomi RAM: The Complete 2026 Guide

Have you noticed how your favorite app suddenly closes in the background, losing game progress or important data? On Xiaomi smartphones, this problem is especially relevant because of the aggressive optimization of MIUI, which forcibly clears the background processes. The solution is: fix the application in RAM (RAM), which will prevent it from automatically closing and speed up the re-launch.

In this article, you'll learn how to lock an app into memory on any Xiaomi, Redmi, POCO or Black Shark device, from budget models to flagships. We'll look at both standard methods through MIUI settings and hidden features for power users. Importantly, not all applications can be fixed, and some methods require ADB or bootloader unlocking. But most instructions work without root rights.

Before you start, check your firmware version: Settings path โ†’ About Phone โ†’ MIUI version. Current methods were tested on MIUI 12-15 (including HyperOS for new models). If you have an older version, update the system first.

Why Xiaomi Closes Apps in the Background and How to Fix It

Xiaomi smartphones are known for aggressive RAM optimization, which is due to the features of MIUI firmware, which prioritizes energy efficiency over multitasking.

  • ๐ŸŽฎ Games (e.g. Genshin Impact or PUBG Mobile) departs when switching to another chat.
  • ๐Ÿ’ฌ Messengers (Telegram, WhatsApp) do not send notifications in a timely manner.
  • ๐ŸŽต Music players (Spotify, YouTube Music) stop after 5-10 minutes in the background.
  • ๐Ÿ“Š Tracking apps (like Strava) lose data when they lock the screen.

The reason lies in the mechanism of Memory Management, which forcibly kills processes if:

  • ๐Ÿ“‰ Battery level below 15%.
  • ๐Ÿ”„ The phone has not been used for a long time (the screen is off for more than 30 minutes).
  • ๐Ÿš€ Too many applications running at the same time (background process limit exceeded).
  • ๐Ÿ”‹ Power Saving Mode or Ultra Battery Saver.

The attachment of the application to RAM removes these restrictions for the selected programs.

โš ๏ธ Note: Fixing an application in memory increases battery consumption by 5-15%. Do not attach more than 3-4 applications at the same time - this can lead to system lags.

๐Ÿ“Š Which app you most often close in the background?
Games (PUBG, Genshin Impact, etc.)
Messengers (Telegram, WhatsApp)
Music players (Spotify, YouTube Music)
Social networks (TikTok, Instagram)
Other

Method 1: Fixing through MIUI settings (without root)

The easiest method is to use the built-in โ€œStickโ€ feature in the multitasking menu, which works on all Xiaomi devices with MIUI 12 and later, including POCO and Redmi.

Step-by-step:

  1. Open the application you want to secure (e.g. Telegram).
  2. Click the "Recent Apps" button (square or swipe up from the bottom panel).
  3. Find the card of the desired application and make a long press on its title.
  4. In the menu that appears, select "Secure" (icon with a pin) ๐Ÿ“Œ).
  5. Confirm the action by clicking "Secure" in the dialog box.

Now the app will remain in memory even when you clear the RAM through the "Close All" button to undo the fixing:

  • ๐Ÿ“Œ Open the multitasking menu again.
  • ๐Ÿ” Find the attached application (it will be marked with a pin).
  • ๐Ÿ–ฑ๏ธ Make a long press and select "Unlock".

Limitations of the method:

  • โŒ Does not work for system applications (e.g. com.android.systemui).
  • โŒ Maximum can be fixed to 4 applications at the same time.
  • โŒ After restarting the phone, the fixing is reset.

โ˜‘๏ธ Preparation for securing the annex

Done: 0 / 4

Method 2: Setup autostart and background activity

If standard anchoring doesnโ€™t work (like WhatsApp or Viber), try setting up autostart and background activity to prevent the system from killing the process.

Instructions:

  1. Go to Settings โ†’ Applications โ†’ Application Management.
  2. Select the application you want (such as Spotify).
  3. Slip on AutoRun and turn on the slider.
  4. Go back and select "Background Activity" โ†’ set "No Limits".
  5. In the "Energy consumption" section, select "No restrictions".
  6. Restart your phone to apply the changes.

For some applications (for example, messengers) it is also useful:

  • ๐Ÿ”” Enable "Show notifications" in the application settings.
  • ๐Ÿ“ถ Allow "Autostart in Mobile Data" (if using mobile Internet).
  • ๐Ÿ”„ Disable "Battery Optimization" for the application.

This method does not fix the application in RAM on a permanent basis, but it significantly reduces the likelihood of it being closed.

โš ๏ธ Attention: Setting up "No Limits" for more than 5 apps can lead to increased battery consumption and overheating of the processor. โ†’ Battery โ†’ Battery status.

AnnexRecommended settingsExpected impact
TelegramAuto Start + Background Activity + NotificationsInstant notifications, no chat loss
Spotify/YouTube MusicBackground activity + Without battery restrictionsMusic Plays in the Background >1 Hours
PUBG Mobile/Genshin ImpactFixing in RAM + Performance ModeNo departures when switching to the messenger
Google Maps/Yandex.NavigatorAuto Launch + Exact LocationNavigation works in the background without failure

Method 3: Using ADB for Forced Attachment (Advanced)

If standard methods don't work, you can use Android Debug Bridge (ADB), a debugging tool that allows you to manage system settings, which does not require root, but requires a connection to a computer.

What you need:

  • ๐Ÿ–ฅ๏ธ Computer with Windows, macOS or Linux.
  • ๐Ÿ”Œ USB-cable (preferably original).
  • ๐Ÿ“ฅ Installed Xiaomi drivers (official website).
  • ๐Ÿ› ๏ธ Utility. ADB (Download Platform Tools).

Step-by-step:

  1. Turn on Developer Mode: Go to Settings โ†’ About Phone. Tap 7 times on MIUI Version. Enter your password if you need to.

"Debugging by USB"

  • Back to Settings โ†’ Additionally. โ†’ For developers.
  • Turn on the USB debugging slider.
  • Confirm the action by pressing โ€œOKโ€ in the dialog box.
  • Connect the phone to your computer and select File Transfer mode.
  • Open the command prompt (or Terminal on macOS/Linux) in the ADB folder.
  • Enter the command to check the connection: Adb devices must appear serial number of your device.
  • Give permission to fix in memory: adb shell cmd appops set <package_name> RUN_ANY_IN_BACKGROUND allow Replace <package_name> to the application ID (e.g. com.whatsapp for WhatsApp).
  • For compulsory exclusion from optimization, enter: adb shell dumpsys deviceidle whitelist +<package_name>

Now, after each reboot, Tasker will automatically pin selected apps to memory. For multiple applications, add individual commands via a separator;

cmd appops set com.whatsapp RUN_ANY_IN_BACKGROUND allow; dumpsys deviceidle whitelist +com.whatsapp


cmd appops set org.telegram.messenger RUN_ANY_IN_BACKGROUND allow; dumpsys deviceidle whitelist +org.telegram.messenger

Advantages of the method:

  • โœ… It works without root.
  • โœ… Automating routine activities.
  • โœ… Allows you to secure an unlimited number of applications.

Disadvantages:

  • โŒ Requires customization and understanding of Tasker.
  • โŒ It may be in conflict with other automation systems.
  • โŒ Increases the load on the processor when the system is loaded.