GithubHelp home page GithubHelp logo

liangdahong / amleaksfinder Goto Github PK

View Code? Open in Web Editor NEW
140.0 140.0 23.0 82.36 MB

A small tool for automatically detecting the [controller, view memory leak] in the project. 一款用于自动检测项目中【控制器内存泄漏,View 内存泄漏】的小工具,支持 ObjC,Swift。

Home Page: https://liangdahong.com/2020/06/08/iOS%E4%B8%AD%E5%A6%82%E4%BD%95%E8%87%AA%E5%8A%A8%E7%9B%91%E6%8E%A7%E6%8E%A7%E5%88%B6%E5%99%A8%E5%86%85%E5%AD%98%E6%B3%84%E6%BC%8F/

License: MIT License

Objective-C 97.24% Ruby 0.69% Shell 0.18% Swift 1.89%
controller ios leak leaks meaksfinder memory memory-leak mleaksfinder objective-c runtime

amleaksfinder's Introduction

  • Hello
  _     _   _                  _____ _                       _       _
 | |__ | |_| |_ _ __  ___ _   / / / (_) __ _ _ __   __ _  __| | __ _| |__   ___  _ __   __ _   ___ ___  _ __ ___
 | '_ \| __| __| '_ \/ __(_) / / /| | |/ _` | '_ \ / _` |/ _` |/ _` | '_ \ / _ \| '_ \ / _` | / __/ _ \| '_ ` _ \
 | | | | |_| |_| |_) \__ \_ / / / | | | (_| | | | | (_| | (_| | (_| | | | | (_) | | | | (_| || (_| (_) | | | | | |
 |_| |_|\__|\__| .__/|___(_)_/_/  |_|_|\__,_|_| |_|\__, |\__,_|\__,_|_| |_|\___/|_| |_|\__, (_)___\___/|_| |_| |_|
               |_|                                 |___/                               |___/

amleaksfinder's People

Contributors

jinxiansen avatar liangdahong avatar lisonfan avatar mlch911 avatar reliable-d avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

amleaksfinder's Issues

不能用于swift 吗?

我用swift写了内存泄漏的代码,但是没有检测出来啊

        btn.onClick {
            self.navigationController?.popViewController(animated: true)
        }

UITextField误报?

在一个VC上TableViewCell上添加UITextField,初始化时设置UITextField的text的值 ,后续调用UITextField修改,pop后提示UITextField泄漏。再次进入又销毁了。

FBRetainCycleDetector 无法编译问题处理

在 Podfile 中使用

pod 'FBRetainCycleDetector', :git => 'https://github.com/facebook/FBRetainCycleDetector.git', :branch => 'main', :configurations => ['Debug']

代替

pod 'FBRetainCycleDetector'

会崩溃

引入FBRetainCycleDetector后,点击【查看控制器的所有强引用对象】后,会崩溃
image

对比MLeakFinder

问一下, 你这个和MLeakFinder 有什么区别? 或者说有什么优势?

SceneDelegate的显示问题

项目用的SceneDelegate且初始化的VC使用了Storyboard的时候遇到,AMLeaksFinder在切换rootViewVC的时候会显示一点点,然后就不见了。。
15071716780848_ pic

解决
在 UIViewController+AMLeaksFinderUI.m 文件
+load

  • (void)udpateUI 修改
    UIWindow *keyWindow = nil;
    for (UIScene *scene in [UIApplication sharedApplication].connectedScenes) {
        if ([scene isKindOfClass:[UIWindowScene class]]) {
            UIWindowScene *windowScene = (UIWindowScene *)scene;
            for (UIWindow *window in windowScene.windows) {
                if (window.isKeyWindow) {
                    keyWindow = window;
                    break;
                }
            }
            if (keyWindow) {
                break;
            }
        }
    }

//window替换为keyWindow
            [keyWindow addSubview:memoryLeakView];
            [keyWindow addSubview:leakOverviewView];

看作者有其他处理方式没 我目前使用的这个方式解决

hello

I used a singleton example and found that there was a problem

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.