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

iOS 运行你们给的demo,push很多页面,内存从50M升到130M。pop到根控制器内存才降了10M,我的flutter版本是1.0.0 #34

Closed
ifbowen opened this issue Mar 18, 2019 · 14 comments

Comments

@ifbowen
Copy link

ifbowen commented Mar 18, 2019

No description provided.

@ifbowen
Copy link
Author

ifbowen commented Mar 18, 2019

老版本hybrid_stack_manager没问题

@nightwolf-chen
Copy link
Contributor

能把memgraph导出来看看吗

@ifbowen
Copy link
Author

ifbowen commented Mar 18, 2019

@nightwolf-chen
Copy link
Contributor

我看内存里有两个FlutterViewController,确认一下是否初始化多个FlutterViewController

@ifbowen
Copy link
Author

ifbowen commented Mar 19, 2019

就是运行你们官方demo,啥也没改。你在什么地方看见两个FlutterViewController的啊😳
屏幕快照 2019-03-19 下午5 55 46

@gilnuy
Copy link

gilnuy commented Mar 21, 2019

确实有内存问题,我在页面里面申请了一大块内存,调用路由的pop方法,跟了断点,确实也走了dealloc方法,并且也通知到了 dart层,但是dart层没有销毁内存。

class PageState1 extends State<PageFull1> {
  List list;
  void initState () {
   list = List();
    for (var i=0;i<1000000;i++) {
      list.add("$i");
    }
  }
  @override
  Widget build(BuildContext context) {
    return Container(color: Colors.blue);
  }
  @override
  void dispose() {
    list.clear();
    super.dispose();
  }
}

@gilnuy
Copy link

gilnuy commented Mar 21, 2019

pages.zip

如图:从page2返回到page1,内存没有变化。

@nightwolf-chen
Copy link
Contributor

FlutterViewController 是以单例存在的,这个东西初始化以后会有一个固定的内存消耗不会进行释放。至于页面,取决于Native的容器VC是否释放。

@gilnuy
Copy link

gilnuy commented Mar 21, 2019

FLBFlutterViewContainer dealloc方法断点到了,page的 dispose方法也走了。

@nightwolf-chen
Copy link
Contributor

FLBFlutterViewContainer 这个是容器,释放后对应的flutter widget应该会释放,但是Flutter对应的固定内存是不会释放的。

@gilnuy
Copy link

gilnuy commented Mar 21, 2019

但是widget里申请的内存没有得到释放。 重复进入这个页面内存只增加 不减少, 可以在你们的example的firstwidget里面试试,反复进入firstwidget试试。

@gilnuy
Copy link

gilnuy commented Mar 21, 2019

目前我的flutter 版本是 stable v1.2.1,既然vc和widget释放了,内存没有完全释放,猜测很可能是flutter engine的问题,先mark下吧,看能否找到其他解决办法

@Gengpp
Copy link

Gengpp commented Jul 4, 2019

目前我的flutter 版本是 stable v1.2.1,既然vc和widget释放了,内存没有完全释放,猜测很可能是flutter engine的问题,先mark下吧,看能否找到其他解决办法

大神,好。麻烦问一下,该问题解决了吗?

@jaysonss
Copy link

jaysonss commented Jul 5, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants