Some records of resource allocation and recycling of Android small memory machines

Project scenario:

Need to develop an Android TV with a player on a small memory development board


Problem Description

Since the author's android tv Launcher project has an audio and video player implemented by himself, it is necessary to release this part of the occupied memory immediately when returning to the main interface. No matter calling GC or other methods, it cannot be executed immediately, and it may even be unavailable. to execute.


solution:

A more evil method:

Using multi-process , audio and video are run in separate processes.

Because Laucher also implements the function of clearing background processes, the audio and video processes will be cleared immediately after returning to the main interface.

Disadvantage: More process overhead.

Pros: Timely.

This method needs to be combined with actual usage scenarios.

Guess you like

Origin blog.csdn.net/weixin_44917215/article/details/126411186