tencent cloud

All product documents
Tencent Cloud Super App as a Service
Operation Mechanism
Last updated: 2025-02-24 17:10:37
Operation Mechanism
Last updated: 2025-02-24 17:10:37

Foreground/Background state

When a mini game is launched and its API is displayed to the user, it is in the foreground state.
If the user taps the capsule button in the top right corner to close the mini game or presses the device's Home button to leave the host app, the mini game does not completely terminate but enters the background state, where it can continue running for a short period.
When the user re-enters the host app or reopens the mini game, it transitions from the background to the foreground. However, if the user does not return to the mini game for an extended period or if system resources are constrained, the mini game may be destroyed, meaning it is completely terminated.

Mini game launch

There are two types of mini game launches: cold launch and hot launch.
Cold launch: This occurs when the user opens the mini game for the first time or reopens it after it has been destroyed. The mini game needs to reload and start from scratch.
Hot launch: This occurs when the user has previously opened the mini game and reopens it within a certain period. The mini game has not been destroyed and simply transitions from the background to the foreground.

Mini game destruction timing

A mini game is typically destroyed under the following conditions:
Extended background state: If the mini game remains in the background for a certain period without returning to the foreground, it will be destroyed.
High system resource usage: If the mini game consumes too many system resources, it may be destroyed by the system or actively reclaimed by the host app.
iOS memory warnings: On iOS, if the host app receives consecutive system memory warnings within a certain interval, it may actively destroy the mini game and notify the user with a message like "Insufficient memory, please reopen the mini game." The specific strategy for this is continuously adjusted and optimized.
It is recommended that mini games use wx.onMemoryWarning to listen for memory warning events and perform necessary memory cleanup when needed.



Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 available.

7x24 Phone Support
Hong Kong, China
+852 800 906 020 (Toll Free)
United States
+1 844 606 0804 (Toll Free)
United Kingdom
+44 808 196 4551 (Toll Free)
Canada
+1 888 605 7930 (Toll Free)
Australia
+61 1300 986 386 (Toll Free)
EdgeOne hotline
+852 300 80699
More local hotlines coming soon