Memory leakage detection method and apparatus for Android application

A technology for memory leaks and detection methods, applied in the field of Android system memory management, can solve problems such as program crashes and occupy a lot of memory, and achieve the effects of improving robustness, simple and flexible use, and improving development efficiency.
CN107239394AInactive Publication Date: 2017-10-10卓望数码技术(深圳)有限公司

Patent Information

Authority / Receiving Office
CN · China
Current Assignee / Owner
卓望数码技术(深圳)有限公司
Publication Date
2017-10-10
Estimated Expiration
Not applicable · inactive patent

Smart Images

  • Figure 1
    Figure 1
  • Figure 2
    Figure 2
Patent Text Reader

Abstract

The present invention discloses a memory leakage detection method and apparatus for an Android application. The memory leakage detection method comprises: establishing a weak reference audio monitor, wherein the weak reference audio monitor monitors the Activity component of the currently running application; and when the Activity component is destroyed, detecting whether there is a reference to the Activity component, if so, triggering a memory recovery mechanism, and detecting whether there is a weak reference to the Activity component. Beneficial effects of the method and apparatus disclosed by the present invention are that, by arbitrarily setting a monitor object, monitoring of the memory leakage in the application development can be facilitated; and the method and apparatus are simple and flexible, so that not only the robustness of the application is improved, and the development efficiency of the engineer is improved.
Need to check novelty before this filing date? Find Prior Art

Description

technical field

[0001] The invention relates to the technical field of Android system memory management, in particular to a memory leak detection method and device for Android applications. Background technique

[0002] In the code writing based on the Android (Android) system, according to the working experience of the developer, the code that is prone to memory leaks is generally processed.

[0003] Currently, in Android application development, objects still hold references to the objects after they are used, so that previously allocated memory cannot be reclaimed, resulting in memory leaks. This requires developers to exercise additional control over codes that are prone to memory leaks to prevent memory leaks. For example, the importance of context (context environment) is self-evident. Context has its own life cycle. If it is used improperly, it will always hold a reference to the context, which will cause the existence of the context to exceed its own life cycle, whi...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More