You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@echarts.apache.org by GitBox <gi...@apache.org> on 2019/03/27 01:36:12 UTC

[GitHub] [incubator-echarts] whidy edited a comment on issue #7234: vue + echarts 单页面大数据加载性能问题

whidy edited a comment on issue #7234: vue + echarts 单页面大数据加载性能问题
URL: https://github.com/apache/incubator-echarts/issues/7234#issuecomment-476920117
 
 
   @zhangwang9li 想请教一下,那不挂载data上面,每个不同的组件都有echarts实例初始化,那切换路由的时候需要在组件destroy里面销毁吗,单页面应用会产生问题吗,
   还是说离开的时候自动被浏览器回收了,
   
   我后来试了一下,同一个带有图表的页面和另一个没有图表的页面切换多次后,内存会不断增加,可能造成的内存泄漏,应该是每次创建了一个闭包环境没有被销毁,就不断增加了。那这样的话不将echarts实例挂在data上面,就没办法销毁了吧。还是其他办法,我也看了[vue-echarts](https://github.com/ecomfe/vue-echarts/blob/master/src/components/ECharts.vue)似乎是挂在data上面。
   
   以及饿了么官方封装的[v-charts issues](https://github.com/ElemeFE/v-charts/issues/467)有人也问到同样的问题。
   
   内存泄露如下图:
   
   ![image](https://user-images.githubusercontent.com/2074757/55043898-2d1f5500-5073-11e9-8bcb-fdb14113e9e2.png)
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@echarts.apache.org
For additional commands, e-mail: dev-help@echarts.apache.org