Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to detect memory leaks? #110322

Closed
Inisit opened this issue Aug 26, 2022 · 2 comments
Closed

How to detect memory leaks? #110322

Inisit opened this issue Aug 26, 2022 · 2 comments
Labels
r: solved Issue is closed as solved

Comments

@Inisit
Copy link

Inisit commented Aug 26, 2022

我编写的应用(大型项目),存在内存泄漏,内存一直居高不下, 创建的widget实例一直在增加,无法被GC回收掉, 有没有什么办法能准确定位到内存泄漏的代码位置? 就例如Android原生的LeakCanary的功能.

Translation:

The application I wrote (large-scale project) has memory leaks, the memory is always high, and the created widget instances keep increasing and cannot be recycled by GC. Is there any way to accurately locate the code location of the memory leak? For example, Android Native LeakCanary functionality.

image

@Inisit Inisit added the from: performance template Issues created via a performance issue template label Aug 26, 2022
@danagbemava-nc danagbemava-nc removed the from: performance template Issues created via a performance issue template label Aug 26, 2022
@darshankawar darshankawar added the in triage Presently being triaged by the triage team label Aug 26, 2022
@darshankawar darshankawar changed the title 如何进行内存泄漏的检测? How to detect memory leaks? Aug 26, 2022
@darshankawar
Copy link
Member

@Inisit
There are several articles and documents out there that shows how to detect memory leaks.

https://stackoverflow.com/questions/57674085/how-to-find-memory-leaks-in-flutter/62471179#62471179
#46050

https://docs.flutter.dev/development/tools/devtools/memory
https://www.alibabacloud.com/blog/exploring-memory-leaks-in-flutter-from-the-rendering-process_597736

There's also a community plugin that you can try and see if it suits your purpose: https://pub.dev/packages/leak_detector

And follow-up in this open issue for updates: flutter/devtools#3951

Closing from here.

@darshankawar darshankawar added r: solved Issue is closed as solved and removed in triage Presently being triaged by the triage team labels Aug 26, 2022
@github-actions
Copy link

github-actions bot commented Sep 9, 2022

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
r: solved Issue is closed as solved
Projects
None yet
Development

No branches or pull requests

3 participants