Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

APP special-memory leak 2

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This time, DDMS is used to test.

Adb devices, device connection is normal

Start App and operate for a while

Start DDMS

On the left, first find the App you just operated, and select

Then click show heap updates in the upper left corner

Then, click VM Heap-- > Cause GC on the right (take the initiative to clean up the garbage)

Follow data object-- > Total Size

Used% can also be used as a reference, mainly observing Total Size.

Continue to operate App

If the value of Total Size is stable in a limited range (it falls after each GC)

Indicates that the code is good and there is no memory leak.

Conversely, if this value is getting larger and larger, there is a memory leak.

If there is a memory leak, Dump HPROF file

Then use the hprof-conv command to convert

Put the converted files into a directory

Then, use MAT to analyze

Open a file

Shallow Heap sort, reverse order

On the first one, right-click, List objects--with incoming references

Put it in reverse order.

Select the first, right, Path To GC Roots-- > penultimate item

Analyze the bottom one. It may be the problem. Just submit a developer.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report